Pattern inspecting method and apparatus thereof, and pattern inspecting method on basis of electron beam images and apparatus thereof

ABSTRACT

A pattern inspecting method and apparatus for inspecting a defect or defective candidate of patterns on a sample includes picking up an image of a sample by shifting a sampling position on the sample, measuring geometric distortion in an image of a standard sample, beforehand, and defining a size for which the measured geometric distortion is neglectable, obtaining a first image of the sample and a second image to be compared with the first image, dividing the first image and the second stage into images of a division unit having a size not greater than the defined size, comparing a divided image of the first image with a divided image of the second image, and for calculating a difference in gradation values between both of the divided images. The defect or the defect candidate of the sample is extracted in accordance with the difference in the gradation values.

CROSS REFERENCE TO RELATED APPLICATION

This application is a continuation application of U.S. application Ser.No. 09/225,512, filed on Jan. 6, 1999, now U.S. Pat. No. 6,614,923 thesubject matter of which is incorporated by reference herein.

BACKGROUND OF THE INVENTION Field of the Invention

The present invention relates to a pattern inspecting method and anapparatus thereof, and a pattern inspecting method on a basis of anelectron beam pictures or images and an apparatus thereof, with which apicture, displaying physical properties of an object such as asemiconductor wafer, TFT, a photo mask and so on, is obtained by use ofan electron beam, a light or the like, and the obtained picture iscompared with a picture which is obtained separately therefrom, therebydetecting defects or quasi-defects (or defective candidates), inparticular the fine or minute ones thereof.

In a conventional art 1, as is described in Japanese Patent Laying-OpenNo. Sho 57-196377 (1982), there is already know a testing or aninspection, wherein a pattern including a repetitive pattern, beingformed on an object to be tested or inspected such as a semiconductorwafer, is detected to be memorized, and the detected pattern is fittedor aligned with to a pattern which is memorized one time before, in anaccuracy of degree of each pixel, thereby extracting a discrepancy ordifference between the two patterns fitted or aligned with in thepositions thereof so as to recognize or acknowledge the defects therein.Further, in a conventional art 2, as is disclosed in Japanese PatentLaying-Open No. Hei 3-177040 (1991), there is also known a technology,wherein a portion due to distortion or deformation in the detectionpoints or positions between two pictures is improved among the problemsof discrepancies or differences between the both images in normalportions thereof. Namely, in the conventional art 2, there is describedthe technology, wherein an object pattern is detected as a picturesignal, and the detected pattern is aligned, or adjusted in the positionby an unit of pixel with that which is memorized in advance or thatwhich is detected separately. The two of them, which are aligned inpositions by the unit of pixel (pixel unit), are further aligned inpositions at a degree being finer or lower than the pixel (i.e.,sub-pixel unit), so as to be compared and extracted errors therefrom inthe image signals of those two patterns which are aligned in positionsat the degree finer than the pixel, thereby recognizing or acknowledgingthe defect(s) of the pattern(s).

Between the two pictures to be compared, there exist the minutedifference in the pattern shape, the differences in the values ofgradation, distortion or deformation in the patterns, misalignment inpositions and so on, even in a normal portion, due to a detection objectsample itself and an image detection system thereof. Namely, as thediscrepancies or inconsistency in the normal portion, there are somewhich are caused by the object itself and other(s) which are caused by aside of the testing or inspecting apparatus thereof.

The discrepancy or inconsistency caused by the test object is mainly dueto a delicate difference caused through a wafer fabricating processes,such as etching and so on. This is because it looks to be the minutedifference in shapes, or as the gray level difference between therepetitive patterns on the detected images.

The discrepancies, which are caused at the testing or inspectingapparatus side, include quantizing errors due to vibration of stages,various electric noises, mis- or mal-focusing and sampling, fluctuationin illumination light amount especially in a case of an optical system,fluctuation in electron beam current especially in a case of an electronbeam system, and gaps or shifts in scanning position of the electronbeam due to electrical charge of the sample and/or of anelectronic-optical system, etc. In particular, in the electron beamsystem, influences due to geometric distortion is remarkable in theperiphery portion of the test object. Those appear in the forms ofdifferences in the gradation values of the portion of the image, thegeometric distortion, and the gaps or shifts in the position.

In the conventional art 1 mentioned above, there are problems that,since the discrepancies occur even in the normal portion due to thecauses of factors listed in the above, erroneous report occurs veryoften if each of those discrepancies is decided to be the defectrestrictively or minutely, one by one. While, if a reference or criteriato decide the defect is loosen or lowered for preventing from the above,it is impossible to detect the minute or fine defect correctly.

Further, with the conventional art 2 mentioned above, though an onlyeffect can be obtained in reducing or lowering the influence due to themisalignment in the positions between the pictures or images, amongthose influences due to the minute difference in the pattern shape, thedifferences in the gradation values, the distortion or deformation ofthe patterns, and the gaps or shifts in positions and so on, which arecaused by the test object itself and the image detecting system thereof,but it is still not sufficient, nor takes the other problems intoconsiderations thereof any more.

SUMMARY OF THE INVENTION

An object is, according to the present invention for dissolving theproblems of the conventional arts mentioned above, to provide a patterntesting method and an apparatus therefor, which can further reduce orlower the possibility of occurring the erroneous reports which arecaused by the discrepancies or differences due to the sample itself andthe image detecting system thereof, so as to enable the detection of themore minute or the finer defects.

Further, an another object of the present invention is to provide apattern testing or inspecting method on a basis of electron beam pictureor image and an apparatus thereof, which can further reduce or lower thePossibility of occurring the erroneous reports which are caused by thediscrepancies due to the sample and the image detecting system, on abasis of the electron beam picture of the test object itself, so as toenable the detection of the more minute or the finer defects.

Further, other object of the present invention is to provide a patterntesting method on a basis of electron beam picture or image and anapparatus thereof, which can further reduce or lower the possibility ofoccurring the erroneous reports which are caused by non-uniformdistortion or deformation on the detected images due to the sample andthe image detecting system thereof, on a basis of the electron beampicture of the sample, so as to enable the detection of the more minuteor the finer defects.

Further, other object of the present invention is to provide a methodand an apparatus therefor, having stable gradation values being suitablefor testing, and being able to obtain an electron beam picture or imagewith less geographic distortion, in the pattern inspecting with use ofthe electron beam image of the sample.

Moreover, further other object of the present invention is to provide amethod and an apparatus therefor, enabling the inspecting all oversurface including a central portion and a peripheral portion as well, ofthe sample in the pattern inspecting with use of the electron beam imageof the sample.

For dissolving the above objects, according to the present invention,there are provided a pattern inspecting method and an apparatus thereofand a pattern inspecting method on a basis of an electron beam image andan apparatus thereof, wherein inspection is made upon defect ordefective candidate on a sample on the basis of a first data which arearranged in two-dimension, by making sampling values in physicalquantity from a certain area selected on the sample as gradation values,and a second image data containing contents which can be a comparisonsample for the first image data, and each of which has the followingfeatures.

Namely, according to the present invention, there are provided an imagedividing and cutting-out step or means thereof, for memorizing saidfirst image data and second image data sequentially for a predeterminedarea, and for dividing and cutting out each of those first and seconddata memorized sequentially into such a small area unit to be able toneglect such as the distortion therein; and a deciding step or meansthereof, for comparing the first divided image and the second dividedimage, which are divided in the image dividing and cutting-out step ormeans thereof for the each division unit so as to calculate differenceof the both images, and for deciding the defect or the defectivecandidate upon the basis of the difference between the both images,which are calculated for the each division unit. Further, according tothe present invention, there are also provided a position shiftdetecting step or means thereof, for detecting the position shiftquantity between the first divided image and the second divided image,which are divided and cut out in said image dividing and cutting-outstep or means thereof for the each division unit; and a deciding step ormeans thereof, for deciding to be the defect or the defective candidateby taking into considerations the position shift quantity which isdetected in the position shift detecting step or means thereof, bycomparing the first divided image and the second divided image, whichare divided in the image dividing and cutting-out step or means thereoffor the each division unit.

Further, according to the present invention, there are provided aposition shift detecting step or means thereof, for detecting theposition shift quantity between the first divided image and the seconddivided image, which are divided and cut out in said image dividing andcutting-out step or means thereof for the each division unit, and adeciding step or means thereof, for deciding to be the defect or thedefective candidate, by comparing the first divided image and the seconddivided image, which are divided in the image dividing and cutting-outstep or means thereof for the each division unit, so as to calculate thedifference in the gradation values between the both images, and bybasing upon a reference value for decision of containing fluctuatingcomponent in the gradation values which can be calculated out dependingon the position shift quantity detected in the position shift detectingstep or means thereof, with respect to the difference between the bothimages in the gradation values calculated for the each division unit.

Further, according to the present invention, there are provided aposition shift detecting step or means thereof, for detecting theposition shift quantity between the first divided image and the seconddivided image, which are divided and cut out in said image dividing andcutting-out step or means thereof for the each division unit; and adeciding step or means thereof, for deciding to be the defect or thedefective candidate, by comparing the first divided image and the seconddivided image, which are divided in the image dividing and cutting-outstep or means thereof for the each division unit, so as to calculate thedifference between the both images depending upon the position shiftquantity detected for the each division unit by the position shiftdetecting step or means thereof, and by basing upon the differencebetween the both images calculated for the each division unit.

Further, according to the present invention, there are provided aposition shift detecting step or means thereof, for detecting theposition shift quantity between the first divided image and the seconddivided image, which are divided and cut out in said image dividing andcutting-out step or means thereof for the each division unit; and adeciding step or means thereof, for deciding to be the defect or thedefective candidate, by comparing the first divided image and the seconddivided image, which are divided in the image dividing and cutting-outstep or means thereof for the each division unit, so as to treat theposition shift compensation depending upon the position shift quantitydetected for the each division unit by the position shift detecting stepor means thereof, by calculating the difference between the firstdivided image and the second divided image on which the position shiftcompensation is treated, and basing upon the difference between the bothimages calculated for the each division unit.

Further, according to the present invention, there is also provided astep of means thereof, for compensating at least one of the gradationvalues so that the first divided image and the second divided image arenearly equal in the gradation values.

Further, according to the present invention, there is also prepared acompensation equation or a compensation data table for measuring thegeographical distortion on the two-dimensional image having the electronbeam image as the image contents thereof, and for compensating thedistortion in advance, thereby controlling the electron beam scanning byusing the compensation equation or the compensation data table.

Further, according to the present invention, there are provided apattern inspecting method on a basis of an electron beam picture and anapparatus thereof, which are able to deal with the dynamic imagedistortion.

As mentioned in the above, according to the above constructions, in theinspection of patterns formed on the sample with use of the electronmicroscope, it is possible to reduce the possibility of bringing abouterroneous or false reports due to the sample side and the inspectingapparatus side thereof, which are caused by discrepancies, such as theminute difference in pattern shapes, the difference in the gradationvalues, the distortion or deformation of the patterns, the positionshifts, thereby enabling the detection of the defects or the defectivecandidates in more details. In particular, it is possible to deal withthe dynamic image distortion.

BRIEF DESCRIPTION OF DRAWING(S)

FIG. 1 shows an outline of construction of an first embodiment of apattern inspecting method and an apparatus thereof with use of anelectron microscope, according to the present invention;

FIG. 2 shows a layout of a semiconductor wafer as an example of anobject to be inspected, relating to the present invention;

FIG. 3 shows more details of a pre-processing circuit according to thepresent invention;

FIG. 4 shows a view for explanation of contents which are compensated inthe pre-processing circuit shown in FIG. 3;

FIG. 5 shows a state of distortion distribution on a detected image witha pattern detecting apparatus by use of the electron microscope;

FIG. 6 shows a state in variation of voltage being applied to adeflector;

FIG. 7 shows a view for explaining a state when the image is dividedinto such a size to be negated from distortion thereof;

FIG. 8 shows a positional relationship of division units on a continuousimage data;

FIG. 9 shows construction of a position shift detector portion and adefect decision portion, relating to the first embodiment of the presentinvention;

FIG. 10 shows a time-schedule of process contents in the division unit,which are shown by a solid line and a broken line in FIG. 8;

FIG. 11 shows a view for explaining meaning of the position shift ofsub-pixel unit;

FIG. 12 shows detailed structure of a threshold calculating circuit,according to the first embodiment of the present invention;

FIG. 13 shows a view of the structure of a position shift detectorportion and a defect decision portion in a first variation of the firstembodiment, according to the present invention;

FIG. 14 shows a view of the detailed structure of a thresholdcalculating circuit in a first variation of the first embodiment,according to the present invention;

FIG. 15 shows a view of the structure of a position shift detectorportion and a defect decision portion in a second variation of the firstembodiment, according to the present invention;

FIG. 16 shows a view for explaining the condition of change in thegradation values;

FIG. 17 shows a view of the structure of a position shift detectorportion and a defect decision portion upon combining the first variationand the second variation of the first embodiment, according to thepresent invention;

FIG. 18 shows a view of the structure of a position shift detectorportion and a defect decision portion in a third variation of the firstembodiment, according to the present invention;

FIG. 19 shows a view for explaining the arrangement of alignment factor;

FIG. 20 shows a view of the structure of a position shift detectorportion and a defect decision portion upon combining the first variationand the third variation of the first embodiment, according to thepresent invention;

FIG. 21 shows a view of the structure of a position shift detectorportion and a defect decision portion in a fourth variation of the firstembodiment, according to the present invention;

FIG. 22 shows a view of explaining a concept of the fourth variation ofthe first embodiment, according to the present invention;

FIG. 23 shows a view of the structure of a position shift detectorportion and a defect decision portion upon combining the first variationand the fourth variation of the first embodiment, according to thepresent invention;

FIG. 24 shows a view of the structure of a position shift detectorportion and a defect decision portion upon combining the secondvariation and the third variation of the first embodiment, according tothe present invention;

FIG. 25 shows an outline of the structure of a second embodiment of apattern testing method and an apparatus with use of an electronmicroscope, according to the present invention;

FIG. 26 shows a view of explaining a concept of the second embodimentaccording to the present invention;

FIG. 27 shows a view of explaining effects of the second embodimentaccording to the present invention;

FIG. 28 shows a positional relationship of the division units on acontinuous picture data, according to the second embodiment of thepresent invention;

FIG. 29 shows an example of the structure upon combining the secondembodiment and the second variation of the first embodiment, accordingto the present invention;

FIG. 30 shows another example of the structure upon combining the secondembodiment and the second variation of the first embodiment, accordingto the present invention; and

FIG. 31 shows an outline of construction of a common variation of thefirst embodiment and the second variation of a pattern testing methodand an apparatus with use of an electron microscope, according to thepresent invention.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

Hereinafter, embodiments of a pattern inspection method and an apparatusaccording to the present invention will be fully explained by referringto the attached drawings.

<<First Embodiment>>

A first embodiment of the pattern inspecting method and the apparatusthereof according to the present invention is disclosed in FIG. 1. Here,an object of inspection (i.e., test object to be inspected) 100 such asa semiconductor wafer is scanned with use of an electron gun 30, andelectrons generated from the test object 100 by irradiation of theelectrons are detected, thereby obtaining an image of electron beamsrelating a portion to be scanned depending upon changes in the intensitythereof, so as to conduct the pattern inspection with use of theelectron beam image.

As the test object 100, it includes the semiconductor wafer 1 which isshown in FIG. 2, for example. On the semiconductor wafer 1 are formedand aligned a large number of chips 1 a, each of which comes to be asame product finally. Pattern layout inside of the chip 1 a comprises,as shown in an enlarged view of the same figure, memory mat portions 1 cin each of which memory cells are aligned at a same pitchtwo-dimensionally, regularly, and peripheral circuit portions 1 b. Thepattern inspection of this semiconductor wafer 1 is practiced, forinstance, by memorizing an image or picture of a certain chip (forexample, a chip 1 d) detected in advance and by comparing it with theimage detected on other chips (for example, the chip 1 e) (hereinafter,it is called by “die to die comparison”), or alternatively, bymemorizing the image or picture of a certain memory cell (for example, amemory cell 1 f) detected in advance and by comparing it to the imagedetected on other cell (for example, the cell 1 g) (hereinafter, it iscalled by “cell to cell comparison”).

The present pattern inspecting system comprises, as shown in FIG. 1, adetector portion 101, an image pick-out portion 102, an image processingportion 103, and a total controller portion 104 for controlling thesystem as a whole. To the total controller portion 104 are connected aninput means 146 including a recording medium for inputting informationrelating to the test object 100 and a standard or reference sample and anetwork as well, and a display means 148 for displaying (or monitoring)various control information and also information relating to the defectsand/or those looking to be like the defects (i.e., the defectivecandidates) which can be obtained from the image processing portion 103.Further, the present pattern inspection system comprises an inspectionchamber 105 which is evacuated and vacuumed therein, and a preliminarychamber (not shown in the figure) for carrying in and out the inspectionobject 100 into inside of the inspection chamber 105, wherein thepreliminary chamber is so constructed that it can be evacuated andvacuumed independent upon the inspection chamber 105.

<Detector Portion 101 of the First Embodiment>

First, the detector portion 101 will be explained by referring to FIG.1.

Namely, an interior of the inspection chamber 105 in the detectorportion 101 is constructed roughly with an electron optic system 106, anelectron detector portion 107, a sample chamber 109 and an opticalmicroscope portion 108. The electrical optical system 106 is constructedwith an electron gun 31, an electron pulling electrode 111, a condenserlens 32, a deflector 113 for blanking, a scanning deflector 34, a choke114, an objection lens 33, a reflection plate 117, an ExB deflector 115and a Faraday cup for detecting beam current (not shown in the figure).The reflection plate 117 is in a conical shape so as to have a secondaryelectron multiplication function.

An electron detector 35 for detecting such as the secondary electronsand/or reflected electrons of the electron detector portion 107 ispositioned in the inspection chamber 105, for instance, above theobjection lens 33. An output signal of the electron detector 35 isamplified by an amplifier 36 which is provided outside of the inspectionchamber 105.

The sample chamber 109 is constructed with an X stage 131, a Y stage132, an iconometer 134 for position monitoring, and a height measuringinstrument 135 for measuring height of an inspection substrate. However,in place of such the stages as mentioned in the above, a rotary stagecan also be provided therefor.

The iconometer 134 for position monitoring monitors the positions of thestages 131, 132 and so on, and transfers the result thereof to the totalcontroller portion 104. Further, a driving system of the stages 131, 132is also controlled by the total controller portion 104. As a result, thetotal controller portion 104 is able to obtain the region and/orposition where the electron beam 30 is irradiated upon, correctly on abasis of those data.

The height measuring instrument 135 for the inspection substrate, inwhich an optical measuring instrument is used, measures the height ofthe test object 100 which is positioned on the stages 131, 132. Then, ona basis of the measured data obtained from the height measuringinstrument 135, the focus distance of the objection lens 33 is adjustedfor condensing the electron beam finely dynamically, thereby beingconstructed in such that the electron beam is always irradiated upon theinspection region under a condition of being in focus. Though the heightmeasuring instrument 135 of the inspection substrate is positionedinside the inspection chamber 105 in FIG. 1, however, it can bepositioned outside the inspection chamber 105, wherein the light isprojected inside the inspection chamber 105 through a glass window orthe like.

The optical microscope portion 108 is positioned in a vicinity of theelectron optic system 106 within the room of the inspection chamber 105,being separated at such a distance that they do not have influences toeach other, and the value of the distance between the electron opticsystem 106 and the optical microscopic portion 108 is, of course,already known. Then, the X stage 131 or the Y stage 132 moves at theknown distance between the electron optic system 106 and the opticalmicroscope portion 108, reciprocally. The optical microscope portion 108is constructed with a light source 142, an optical lens 141, and a CCDcamera 140. The optical microscope portion 108 detects an optical imageor picture of the test object 100, for instance the circuit patternswhich are formed on the semiconductor wafer 1. On the basis of thedetected optical image is calculated a rotary shift or discrepancy inthe circuit patterns, and the calculated rotary shift is sent to thetotal controller portion 104. Then, the total controller portion 104 isable to adjust or compensate the rotary shift by rotating the rotarystage for instance, by an amount or quantity of the rotary shift.Further, the total controller 104 sends the quantity of the rotary shiftto a compensation controller circuit 143 so that the compensationcontroller portion 14 compensates a position of scanning and deflectionby the electron beam, for example through the scanning defector 34,thereby enabling the compensation of the rotary shift. Further, theoptical microscope portion 108 detects an optical image of the testobject 100, for instance the circuit patterns which are formed on thesemiconductor wafer 1, so as to be displayed, for example on a monitor(not shown in the figure) to be observed. By inputting coordinates intothe total controller portion 104 with use of an input means 146 on abasis of the optical image being observed, it is also possible to set upan inspection area or region into the total controller portion 104. Or,for example, by measuring pitches between or among chips on the circuitpatterns formed on such the semiconductor wafer 1 or a repetitivepitches of the repetitive patterns of such the memory cells, in advance,it is also possible to input them into the total controller portion 104.Although the optical microscope portion 108 is positioned inside theinspection chamber 105 in FIG. 1, it can also be positioned outside theinspection chamber 105, thereby detecting the optical image of thesemiconductor wafer 1 through the glass window or the like.

As shown in FIG. 1, the electron beam emitted from the electron gun 31passes through the condenser lens 32 and the objection lens 33, and iscondensed into a beam having a diameter of about a pixel size on asample surface. In this instance, by means of a ground electrode 38 anda retarding electrode 37, a negative potential is applied to the sample100 so as to decelerate the electron beam between the objection lens 33and the test object (i.e., the sample) 100, thereby obtaining highresolving power in a low acceleration voltage region. When beingirradiated by the electron beam, electron is generated from the testobject 100 (i.e., the wafer 1). With the repetitive scanning of theelectron beam in the X direction by the scanning deflector 34 and withthe detection of the electron which is generated from the test object100 (i.e., the sample) in synchronism with the continuous movementthereof in the Y direction by the stage 132, a two (2) dimensionalelectron beam image of the test object 100 can be obtained withcontinuity (i.e., a continuous image data).

However, a potential distribution is created by the ground electrode 38and the retarding electrode 37 in a retarding method, and an effectiveacceleration voltage is reduced thereby. Even if the stage 132 moves sothat an inspection spot comes to an edge (periphery portion) of the testobject 100, no distortion occurs as far as the potential distribution issame to that in the central portion, and for that purpose, it isnecessary to make the electrodes (i.e., the ground electrode 38 and theretarding electrode 37) large endlessly. However, since it is impossibleto enlarge the electrodes endlessly, it is very difficult to bring theedge portion (i.e., the peripheral portion) of the test object and thecentral portion thereof in magnetic field distribution in the retardingmethod, therefore, even assuming that no distortion lies in the centralportion, there still lies the distortion, in particular, in theperipheral portion of the test object. In this manner, since themagnetic field distribution is distorted in the peripheral portion ofthe test object 100, the scanning of the electron beam is disturbed, andas the result of this, the distortion or deformation is caused in thedetected image (see FIG. 5). Under the condition shown in FIG. 5, it isdifficult to inspect the test object all over. As a measure for this, inadvance to the inspection, by mounting on the stage 132 the standard orreference sample on which the repetitive patterns having previouslyknown in sizes or shapes thereof are formed, the image which is obtainedfrom such the reference sample in the image pick-up portion 102, isdetected and preprocessed to be memorized into memories 42 a or 42 b.For example, by means of a computer (CPU) within the total controllerportion 104 or other computer(s) connected to the total controllerportion 104, having the distortion which is calculated from the detectedimage preprocessed and memorized in the memories 42 a or 42 b inadvance, the electron beam is controlled in scanning speed and scanningpoint (i.e., X coordinate and Y coordinate) by the deflection controllerportion 144 through the compensation controller portion 143, wheninspecting. For example, the voltage given to the deflector 34 ischanged from a solid line in FIG. 6 to a broken line therein. Since thedistortion due to the retarding is reproductive, the distortion can beimproved by this method, thereby expanding the region in which theinspection can be done or carried out. For obtaining the data of thedistortion in advance, it is preferable to use a sample, for example, onwhich the same patterns are aligned regularly at appropriate pitches.Or, alternatively it is also possible to manufacture a special samplefor use in the measurement of the distortion or deformation, on whichsuch the patterns are formed. And, for obtaining the data of thedistortion in advance, the image is detected on the sample with the testpatterns having the appropriate pitches in the image pick-up portion102, and the distortion can be measured on the image detected by thecomputer (CPU) within the total controller portion 104 or thecomputer(s) which is/are connected to the total controller portion 104.The computer mentioned in the above recognizes or acknowledges theposition for each minimum unit of the repetitive pattern on the image(alternatively, it may acknowledges or recognizes appropriate featuresof the repetitive patterns, or may performs so-called a templatematching with use of the minimum unit of the repetitive patterns, as thetemplate thereof), and it is able to calculate and measure the amount orquantity of distortion by comparing the position being acknowledged withthe position at which the above pattern should be located. Although themanner of the distortion is almost reproductive as far as the sample isequal in sizes, however, it comes to be different in the manner of thedistortion or deformation if the samples differ in sizes thereof,therefore, it is necessary to have the compensation data for therespective sizes of the samples. Further, on occasions, it differsdepending upon the fact whether the pattern on the sample is made ofinsulating material or of conductive material, therefore, it isnecessary to prepare the compensation data appropriately in the abovecomputer(s).

The electrons generated from the test object (the sample) 100 is caughtby the detector 35 and amplified by the amplifier 36. Here, for enablingthe inspection with high speed, it is preferable to use an electrostaticdeflector having a fast deflection speed as the deflector 34 forscanning the electron beam in the X direction repetitively. Further, itis also preferable to use as the electron gun 31 an electron gun of aheat electric field radiation type, with which the electron beam currentcan be made large thereby shortening the irradiation time, and while touse as the detector 35 a semiconductor detector which can be driven withhigh speed.

<The Image Pick-up Portion 102 in the First Embodiment>

Next, an explanation will be given on the image pick-up portion 102, byreferring to FIGS. 1, 3 and 4.

Namely, an electron detection signal which is detected by the electrondetector 35 in the electron detector portion 107 is amplified by theamplifier 36 and is converted into a digital image data (a gradationimage data) through the A/D converter 39. And, they are so constructedthat the output of the A/D converter 39 is transferred through anoptical conversion means (i.e., a light emitting element) 123, atransfer means (i.e., an optical fiber cable) 124 and an electricconversion means (i.e., a light receiving element) 125. With such theconstruction, it is enough for the transfer means 124 to have a transferspeed which is equal to the clock frequency of the AND converter 39. Theoutput of the A/D converter 39 which is converted into the opticaldigital signal through the optical conversion means (i.e., the lightemitting element) 123, is optically transferred through the transfermeans (i.e., the optical fiber cable) 124 and is also converted into thedigital image data (i.e., the gradation image data) by the electricconversion means (i.e., the light receiving element) 125. A reason forconverting it into the optical signal for the transmission thereof inthis manner is in that the constructive elements from the semiconductordetector 35 up to the optical conversion means 123 for conducting theelectron 52 from the reflection plate 117 into the semiconductordetector 35 (i.e., the semiconductor detector 35, the amplifier 36, theAID converter 39, and the optical conversion means (the light emittingelement) 123), must be floated at a positive high potential by a highvoltage source (not shown in the figure).

More correctly, it is enough that only the semiconductor detector mustbe floated at the high voltage. However, since it is preferable that theamplifier 36 and the A/D converter 39 are positioned directly close tothe semiconductor detector for protecting the signal from mixture withnoises and deterioration thereof, it is difficult to keep only thesemiconductor detector 35 at the positive high voltage, thereforebringing such the constructive elements as mentioned in the above at thehigh voltage as a whole. Namely, since the transfer means (i.e., theoptical fiber cable) 124 is made of high insulating material, the imagesignal fitting to the positive high potential level can be obtained atthe optical conversion means (i.e., the light emitting element) 123, andthe image signal of an earth level (or ground level) can be obtainedfrom the electric conversion means (i.e., the light receiving element)125 after passing through the transfer means (i.e., the optical fibercable) 124.

The pre-processing circuit (i.e., the image compensation circuit) 40 is,as shown in FIG. 3, constructed with a dark level compensation circuit72, an electron source fluctuation compensation circuit 73, a shadingcompensation circuit 74, a filtering processing circuit 81, a distortioncompensation circuit 84 and so on. The digital image data (the gradationimage data) 71 obtained from the electric conversion means (i.e., thelight receiving element) 125 is treated with various image compensationsin the pre-processing circuit (i.e., the image compensation circuit) 40,including the compensation in the dark level, the compensation forfluctuation of the electron source, the shading compensation and so on.In the dark level compensation within the dark level compensationcircuit 72 is, as shown in FIG. 4, the dark level is compensated upon abasis of the detected signal 71 during a beam blocking period, which isextracted on a basis of a scanning line synchronization signal 75.Namely, a reference signal for compensating the dark level renews thedark level to an average of the gradation values at a specific number ofpixels, for instance, at a specific position during the beam blankingperiod, for the each scanning line. In this manner in the dark levelcompensation circuit 72, the dark level compensation is conducted so asto compensate the detected signal which is detected during the beamblanking period to the reference signal which is renewed for the eachline. The compensation of the fluctuation in the electron source withthe electron source fluctuation compensation circuit 73 is practiced, asshown in FIG. 4, by normalizing the detected signal 76 which iscompensated in the dark level with a beam current 77 which is monitoredby the Faraday cup (not shown in the figure) for detecting the abovebeam current with a compensation frequency (for example, a line unit of100 kHz). The fluctuation in the electron source does not changeabruptly, therefore, it is also possible to use the beam current whichwas detected one or several lines before. The shading compensation inthe shading compensation circuit 74, as shown in FIG. 4, is tocompensate the detected signal 78 which is compensated with thefluctuation in the electron source, with the fluctuation in the amountof light depending on the beam scanning position 79 obtained from thetotal controller portion 104. Namely, the shading compensation is tocompensate (i.e., normalize) each of the pixels on a basis of areference data 83 of brightness which is detected in advance. Thereference data 83 of brightness for use in the shading compensation isdetected under the condition that the shading compensation function isturned “off” in advance, and the image data detected is stored into theimage memory (for example, 147). The stored image data is sent to thecomputer which is provided inside the total controller portion 104 orthe host computer which is connected to the total controller portion 104through the network, and is processed to be formed by a software in thecomputer being provided inside the total controller portion 104 or thehost computer being connected to the total controller portion 104through the network. Or it is also possible that the reference data 83of the brightness for use in the shading compensation is calculated andstored in the host computer which is connected to the total controllerportion 104 through the network in advance, and in this case, it isdownloaded when starting the inspection, then it can be taken by the CPUin the shading compensation circuit 74. For coping with a whole field ofview, in the shading compensation circuit 74 are provided two (2) piecesof the compensation memories of the pixel number corresponding toswinging width of the ordinary electron beam (for example, 1024 pixels),therefore they are exchanged during the time period when inspecting anoutside of the region (i.e., the time period shifting from completion ofthe inspection of 1 field view to starting of the inspection of next 1field view). As the compensation data, there are provided a number ofdata corresponding to the pixels when the electron beam is swung at themaximum width (for example, 5,000 pixels), and in this case, it isenough for the CPU to rewrite them into each of the compensationmemories until the completion of the inspection of the next l fieldview.

In the above, after having conducted the dark level compensation (i.e.,compensating the dark level on the basis of the detected signal 71 beamduring the blanking period), the compensation for the fluctuation in theelectron beam current (i.e., monitoring intensity of the beam currentand normalizing the signal with the beam current), and the shadingcompensation (i.e., the compensation for change in the light amountdepending upon the beam scanning position) with respect to the digitalimage data (i.e., the gradation image data) 71 which is obtained fromthe electric conversion means (i.e., the light receiving element) 125,then the quality of image is improved by treating filtering processeswith use such as of a Gaussian filter, an average value filter, or anedge enhancement filter, etc., in the filtering process circuit 81, withrespect to the digital image data (i.e., the degradation image data) 80which is compensated.

Further, if necessary, the distortion or deformation of the image iscompensated by the distortion compensation circuit 84. Though it ispreviously mentioned that the scanning point of the electron beam iscontrolled by controlling the deflector 34 so as to detect and obtainthe image with less distortion, the present distortion compensationcircuit 84 is constructed in such that it compensates the distortion onthe image which is detected once. Namely, investigating or checking arelationship between the detection position of the image and the amountor quantity of distortion in advance, and then formulating acompensation equation (eq. 1) for the distortion depending upon thecoordinates which are shown below, coordinate transformation of thedetected image is practiced in accordance with the compensationequation. Namely, assuming that the coordinates of the pixel beforecompensation are (x, y) and that the coordinates of the pixel aftercompensation is (X, Y), if the compensation equation is a highdimensional polynomial, it can be expressed by the equation (eq. 1)shown below:

$\begin{matrix}{{X = {\sum\limits_{i = 1}^{n}\;{\sum\limits_{J = 1}^{n}{a_{ij}x^{i - 1}y^{j - 1}}}}}{Y = {\sum\limits_{i = 1}^{n}\;{\sum\limits_{J = 1}^{n}{b_{ij}x^{i - 1}y^{j - 1}}}}}} & \left( {{Eq}.\mspace{14mu} 1} \right)\end{matrix}$

For example, if it is a secondary polynomial, such a relationship isestablished as shown below by the following equation (eq. 2):X=a ₁₁ +a ₂₁ x+a ₁₂ y+a ₂₂ xyY=b ₁₁ +b ₂₁ x+b ₁₂ y+b ₂₂ xy  (Eq. 2)

For investigating or checking the relationship between the detectionpoint and the distortion, on the stage 132 is mounted a standard sampleon which are formed the repetitive patterns having known sizes andshapes, and then the detected image is obtained and detected from thesaid standard sample in the image pick-up portion 102. The detectedimage is pre-processed and is stored into the memories 42 a or 42 b, forinstance, and then the computer (CPU) within the total controllerportion 104 or the computer(s) which is/are connected to the totalcontroller portion 104 recognizes or acknowledges the position of eachminimum unit of the repetitive patterns (corresponding to thecoordinates (x, y) of the pixel before the compensation) in the detectedimage which is pre-processed and stored in the memory 42 a or 42 b. Fromthe relationship between the above acknowledged position for eachminimum unit of the repetitive patterns and the position to be laid withsaid repetitive patterns (corresponding to the coordinates (x, y) of thepixel after the compensation), the coefficients a_(ij) and b_(ij) whichare shown in the above equation (Eq. 1) are determined for eachcoordinate of positions on the sample, for example, by a method of leastsquire, and are memorized into the distortion compensation circuit 84.

In the distortion compensation circuit 84, in case that the X and Y arenon-integers, the values of gradation between the pixels are determinedby any one of interpolation approximations. For such the interpolation,a liner approximation expressed by the following equation (eq. 3) can beused for instance.

$\begin{matrix}\begin{matrix}{{f\left( {{x + {dx}},{y + {dy}}} \right)} = {{\left( {1 - {dx}} \right)\left( {1 - {dy}} \right){f\left( {x,y} \right)}} +}} \\{{{{dx}\left( {1 - {dy}} \right)}{f\left( {{x + 1},y} \right)}} +} \\{{\left( {1 - {dx}} \right){dy}\mspace{11mu}{f\left( {x,{y + 1}} \right)}} + {{dxdy}\mspace{11mu}{f\left( {{x + 1},{y + 1}} \right)}}}\end{matrix} & \left( {{Eq}.\mspace{11mu} 3} \right)\end{matrix}$where the gradation values are f(x, y) at the coordinates (x+dx, y+dy)between the pixels. However, the dx and dy lie between 0 to 0.5.

The various compensations which are practiced in the pre-processingcircuit (i.e., the image compensation circuit) 40 shown in FIG. 3 arefor converting the detected images, so as to be advantageous in a defectdetermination process afterward. However, all of those compensations arenot always necessary, nor be in such the sequence as shown in FIG. 3.

By the way, the delay circuit 41 which is constructed with shiftregisters and so on, delays the digital image signal (i.e., thegradation image signal) by a constant time period, being improved in theimage quality and supplied from the pre-process circuit 40, and if thedelay time is obtained from the total controller portion 104 and then itis set to the time period for moving the stage 2 by a distance of a chippitch (i.e., d1 in FIG. 2) for example, the signal g0 being delayed andthe signal f0 not being delayed come to be the image signals of the samepoint on the chips neighboring to each other, thereby practicing the dieto die comparison inspection mentioned in the above. Or, if the delaytime is obtained from the total controller portion 104 and then is setto the time period for moving the stage 2 by a distance of a memory cell(i.e., d2 in FIG. 2), the signal g0 being delayed and the signal f0 notbeing delayed come to be the image signals of the same point on thememory cells neighboring to each other, thereby practicing the cell tocell comparison inspection mentioned in the above. In this manner, thedelay circuit 41 is so constructed to select the delay times arbitrarilyby controlling the pixel position to be read-out on the basis of theinformation which is obtained from the total controller portion 104. Inthe manner mentioned in the above, the digital image signals (i.e., thegradation image signal) f0 and g0 are taken out from the image pick-upportion 102 to be compared with. Hereinafter, the f0 is called by“detection image” and the g0 by “comparison image”.

<Image Processing Portion 103 a of the First Embodiment>

Next, an explanation will be given on the image processing portion 103 awith reference to FIG. 1.

In the first embodiment according to the present invention, thedetection image (i.e., a first image) being the gradation value f0(x,y)at the coordinate (x,y) and the comparison image (i.e., a second image)being the gradation value g0(x,y) at the coordinate (x,y) are comparedto practice the defect determination. First of all, the distortion ofthe image comes to be a problem when comparing them. By means of controlof the deflector 34 or by use of the distortion compensation circuit 84,it is possible to compensate a statistic distortion (i.e., a predictabledistortion), however, dynamic distortions which are caused due tovibration of the stages 131, 132 and so on, and/or change in magneticfield resulted from the pattern distribution of the test object 100cannot be compensated in advance.

According to the present invention, for treating with such the dynamicdistortions, as shown in FIG. 7, the image is divided finely into such asize that the dynamic distortion can be neglected therefrom, and thedefect determination is practiced for each of the unit of the divisions.

The size of the unit of division is determined by taking into theconsideration the following aspects (1), (2) and (3). (1): The degree ofdistortion of the image which is detected in the system.

-   (2): The size of the defect to be detected (the smaller the size of    defect to be detected is, the slighter the distortion turns up to be    a problem).-   (3) If the unit of division is made small, the pixels in each    division unit also comes to be small in the number thereof, thereby    decreasing an accuracy in measuring the shift of the position.

The image processing portion 103 shown in FIG. 1 is the construction fora case of dividing one scanning line in the X direction by the electronbeam into four (4), for instance, as shown in FIG. 8. The continuousimage data f0(x,y) and g0(x,y) are firstly stored into the respectiveimage memories 42 a and 42 b of two dimension, respectively. Those imagememories 42 a and 42 b of two dimension are of such memories having afunction of freely setting an area from which the data can be read-out.In those image memories 42 a and 42 b of the two dimension, there areprovided two-dimension memory portions 421 a and 421 b and registers 422a and 422 b for storing start and termination addresses for read-out,respectively. The total controller portion 104 sets the registers 422 aand 422 b to such values that the image of the position shown in FIG. 8can be processed. With the values, a portion of the image data (i.e.,for each division unit) which are memorized in the memory portions 421 aand 421 b, i.e., f1(x,y) and g1(x,y) are read out. Namely, as shown inFIG. 8, the continuous image data f1(x,y) and g1(x,y) are read out fromthe areas for the division units memorized in the two-dimension memoryportions 421 a and 421 b, which are set into the registers 422 a and 422b for storing the start and termination addresses for read-out by thecoordinates for the division units through the total controller portion104. However, in the above explanation, it is so constructed that theimages which are memorized in the respective two-dimension memoryportions 421 a and 421 b are cut out and read out, by the each area ofthe division unit, which is set by each of the registers 422 a and 422 bfor storing the start and termination addresses for read-out in theimage memories 42 a and 42 b. However, it is further possible to providetwo-dimension memory portions for every division unit, thereby preparingthe continuous image data f1(x,y) and g1(x,y) for the each divisionunit, by cutting out the image of the each division unit from each ofthe two-dimension memory portions 421 a and 421 b on the basis of thecoordinates for the each division unit which is designated by the totalcontroller portion 104 and also by memorizing them into- thetwo-dimension memory portions which are provided for the respectivedivision units.

In the position shift detection portion 44 a for the division unit, onthe first portions f1 a(x,y) and g1 a(x,y) of the image which are readout by a first division unit from the respective two-dimension imagememories 42 a and 42 b with the designation on the basis of thecoordinates for the each division unit from the total controller portion104, position alignment is performed by an unit of the pixel withinpixel unit position aligning portions 441 and 447 so as to output f2a(x,y) and g2 a(x,y), or f4 a(x,y) and g4 a(x,y). Thereafter, in theposition shift detector portion 442 for detecting the position shiftquantity finer than the pixel unit (i.e., sub-pixel unit), a positionshift amount or quantity δxOa in the x direction and position shiftamount or quantity δyOa in the y direction, i.e., a position shiftamount or quantity between f2 a(x,y) and g2 a(x,y) or that between f4a(x,y) and g4 a(x,y) is obtained in an accuracy of the sub-pixel.Similarly, in the position shift detector portion 44 b for a seconddivision unit area, on the second portions f1 b(x,y) and g1 b(x,y) ofthe picture, which are read out by the second division unit from therespective two-dimension image memories 42 a and 42 b with thedesignation on the basis of the coordinates for each division unit fromthe total controller portion 104, the position alignment is performed byan unit of the pixel in the pixel-unit position aligning portion 441 soas to output f2 b(x,y) and g2 b(x,y) or f4 a(x,y) and g4 a(x,y).Thereafter, in the position shift detector portion 442 for detecting theshift in the sub-pixel unit, the position shift quantity δxOb between f2b(x,y) and g2 b(x,y) or δyOb between f4 b(x,y) and g4 b(x,y) is alsoobtained in the accuracy of sub-pixel unit. In the position shiftdetector portions 44 c and 44 d for a third division unit area and for afourth division unit, similarly, on the third portions f1 c(x,y) and g1c(x,y) of the image and the fourth portions f1 d(x,y) and g1 d(x,y)thereof, which are read out by the third division unit and the fourthdivision unit from the respective the two-dimension image memories 42 aand 42 b with the designation on the basis of the coordinates for eachdivision unit from the total controller portion 104, the positionalignments are performed by the pixel unit in the pixel unit positionaligning portions 441 so as to output f2 c(x,y) and g2 c(x,y), f4 c(x,y)and g4 c(x,y) and f2 d(x,y) and g2 d(x,y), or f4 d(x,y) and g4 d(x,y).Thereafter, in the position shift detector portion 442 for detecting theshift in the sub-pixel unit, the position shift quantity δxOc between f2c(x,y) and g2 c(x,y) or δyOd between f4 d(x,y) and g4 d(x,y) is obtainedin the accuracy of the sub-pixel unit. A positional relationships of f1a(x,y), f1 b(x,y), f1 c(x,y) and f1 d(x,y) on continuous data are shownin FIG. 8 in the coordinates by the division units, which the totalcontroller portion 104 sets up and designates into the image memory 42a. A reason for overlapping the division units each other in the areasthereof which the total controller portion 104 sets up and designatesonto the picture memory 42 a, is for avoiding possibility of occurringthe region or area which cannot be tested due to the position shift. Anamount of the overlapping is necessitated to be more than a maximumvalue which can be estimated. The position relationships of g1 a(x,y),g1 b(x,y), g1 c(x,y) and g1 d(x,y) on the continuous data in thecoordinates which the total controller portion 104 sets up anddesignates into the picture memory 42 b, is also similar to the above.In the position shift detector portions 44 a–44 d for the respectivedivision unit areas (i.e., division unit), as shown in FIG. 10, when theprocess of position alignment by the division unit is completed, forexample, with respect to the image which is read out from each of thememories 42 a and 42 b by the division unit being indicated with a solidline in FIG. 8, then a process for position alignment is initiatedbetween the images of the division units f2 a(x,y), f2 b(x,y), f2c(x,y), f2 d(x,y), and images g2 a(x,y), g2 b(x,y), g2 c(x,y), g2 d(x,y)which are indicated by broken lines. Namely, in FIG. 10 (a) is shown thecontents of the process by the each division unit which is indicated bythe solid line, and in FIG. 10 (b) is shown the contents of the processby the each division unit which is indicated by the broken line. Theimages are detected continuously one by one, therefore, the divisionunit indicted by the broken line is executed with the process which wasexecuted one step before by the division unit which is indicated by thesolid line (i.e., a pipe-line process).

Namely, in the time of “(1) process at 441” on the area of the divisionunit indicated by the solid line, the read-out of the division unitindicated by the broken line is done from the image memories 42 a and 42b. Then, in the time of “(2) process at 442 & writing into memories 45a, 45 b” on the division unit indicated by the solid line, the “(1)process at 441” is carried out on the division unit indicated by thebroken line. Then, in the time of “(3) processes at 461, 462” on thedivision unit indicated by the solid line, the “(2) process at 442 &writing into memories 45 a, 45 b” is done on the division unit indicatedby the broken line. Then, in the time of “(4) process at 463” on thedivision unit indicated by the solid line, the “(3) processes at 461,462” on the division unit indicated by the broken line is done. On awhile, as shown in FIG. 8, for avoiding the region or area which cannotbe tested or inspected, the read-out with the overlapping in the ydirection is also necessitated from the image memories 42 a and 42 b.However, between the variations of the first embodiment which will beshown in FIGS. 13, 15, 17, 18 and 20, there can be a difference more orless in the explanation in the above.

Following, an explanation will be given on the position shift detectorportions 44 a–44 d for the respective division units, by referring toFIG. 9. FIG. 9 shows only one set among four sets of the position shiftdetector portions 44 a–44 d and the defect decision portions 46 a–46 d.In the one set of the position shift detector portion 44 for eachdivision unit, after performing the alignment of the position in theaccuracy of the pixel unit within the position aligning portion 441 foreach division unit, the position shift quantities (δxO,δyO) iscalculated in the amount or quantity thereof, by an unit finer than thepixel (i.e., sub-pixel unit).

In the position alignment portion 441 for each division unit in thepixel unit, for example, a comparison image g1(x,y) is shifted in theposition thereof, in such a manner that the position shift quantity ofthe comparison picture g1(x,y) with respect to the detected picturef1(x,y) of each division unit area lies between 0 and 1 pixel, in otherwords, the position where “degree of adjustment” between f1(x,y) andg1(x,y) reaches a maximum value lies between 0 and l pixel.

Further, the “degree of adjustment” mentioned above can be expressed bythe following equation (Eq. 4).ΣΣ|f1−g1|, ΣΣ(f1−g1)²  (Eq. 4)

The above ΣΣ|f1−g1| means the sum of absolute values of the differencesbetween the detected image f0(x,y) and the comparison or reference imageg1(x,y) in the image of all over the division unit areas. While, theΣΣ(f1−g1)² means the value integrated in the x direction and the ydirection all over the respective division unit areas, by multiplyingthe difference between the detected image f0(x,y) and the comparisonimage g1(x,y) by itself. Or, alternatively, a well-known mutualcorrelation between f1 and g1 can also be applied thereto. Here, anexplanation will be given in a case where the ΣΣ|f1−g1| is adopted.

It is assumed that a shift amount or quantity of the comparison imageg1(x,y) in the x direction is mx, and my in the y direction thereof(where mx and my are integers), and e1(mx,my) and s1(mx,my) are definedas the following equations (Eq. 5) and (Eq. 6).e1(mx,my)=ΣΣ|f1(x,y)−g1(x+mx,y+my)|  (Eq.5)s1(mx,my)=e1(mx,my)+e1(mx+1,my)+e1(mx,my+1)+e1(mx+1,my+1)  (Eq. 6)

In the (Eq. 5), ΣΣ means the sum within each division unit area. Whatshould be obtained here are the shift amount or quantity mx in the xdirection and that in the y direction, so that the s1(mx,my) is minimum.Therefore, the s1(mx,my) is calculated in each time when the mx and myare varied ±0, 1, 2, 3, 4 n, in other words by shifting the comparisonimage g1(x,y) by the pitch of the pixel in each division unit area.Then, the values of mx and my, i.e., mx0 and my0 when it is at theminimum value are obtained. However, the maximum shift amount orquantity n of the comparison image must be a large value depending uponthe positioning accuracy of the detector portion 101, i.e., the larger,the worthier in the positioning accuracy.

From the pixel unit position aligning portion 441 for each divisionunit, the comparison image g1(x,y) obtained for each division unit isoutputted, being shifted by (mx0,my0) while keeping the detected imagef1(x,y) obtained for each division unit area as be original one (i.e.,without change therein). Namely, f2(x,y)=f1(x,y) andg²(x,y)=g1(x+mx0,y+my0). However, if the images f1 and g1 are originallysame to each other in the sizes, the areas at the pixel width mx0 andthe pixel width my0 comes to be invalid due to the position shift of mx0and my0 on the periphery of the picture of each division unit are (sinceit is the area where there is no picture to be compared with). In FIG.8, the overlap between the division units is due to existence of thoseinvalid areas.

In the position shift detector portion 442 for each division unit area,detecting it in the sub-pixel unit, the position shift quantity lessthan the pixel is calculated over the division unit area (the positionshift quantity comes to be a real number between 0 and 1). The positionshift quantity over the division unit area is a condition as shown inFIG. 11. In FIG. 11, a squire indicated by a chained line is the pixel,and it is a unit that is detected by an electron detector 35 and to beconverted into a digital value by sampling with the AND converter 39.

In the same figure, the comparison image g2 for each division unit area(over the division unit) is shifted in the position, by only 2*δx in thex direction and 2*δy in the y direction, with respect to the detectedimage f2 (over the division unit areas). For measuring the degree ofadjustment, there is also a choice as indicated by the equation (Eq. 4),however, here is shown an example where the “sum of squires of thedifferences” (i.e., ΣΣ(f1−g1)²) is applied to.

Now, it is assumed that the position shift amount or quantity at acentral position of the detected image f2 (x,y) for the each divisionunit and the comparison image g2(x,y) for the each division unit is zero(0). Namely, under the condition shown in FIG. 11, it is assumed that f2is shifted only by −δx in the x direction and by −δy in the y direction,and g2 is shifted only by +δx in the x direction and by +δy in the ydirection. Since δx and δy are not the integers, there is a necessity ofdefining the value between the pixel and the pixel for shifting it onlyby δx and δy. The detected image f3 for the each division unit area,which is shifted by +δx in the x direction and by +δy in the ydirection, and the comparison image g3, which is shifted by −δx in the xdirection and by −δy in the y direction, are defined by the followingequations (Eq. 7) and (Eq. 8).

$\begin{matrix}\begin{matrix}{{{f3}\left( {x,y} \right)} = {{f2}\left( {{x + {\delta\; x}},{y + {\delta\; y}}} \right)}} \\{= {{{f2}\left( {x,y} \right)} + {\delta\;{x\left( {{{f2}\left( {{x - 1},y} \right)} - {{f2}\left( {x,y} \right)}} \right)}} +}} \\{{\delta\;{y\left( {{{f2}\left( {x,y} \right)} + 1} \right)}} - {{f2}\left( {x,y} \right)}}\end{matrix} & \left( {{Eq}.\mspace{11mu} 7} \right) \\\begin{matrix}{{{g3}\left( {x,y} \right)} = {{g2}\left( {{x - {\delta\; x}},{y - {\delta\; b\; y}}} \right)}} \\{= {{{g2}\left( {x,y} \right)} + {\delta\;{x\left( {{{g2}\left( {{x - 1},y} \right)} - {{g2}\left( {x,y} \right)}} \right)}} +}} \\{\delta\;{y\left( {{{g2}\left( {x,{y - 1}} \right)} - {{g2}\left( {x,y} \right)}} \right.}}\end{matrix} & \left( {{Eq}.\mspace{11mu} 8} \right)\end{matrix}$

The equations (Eq. 7) and (Eq. 8) are so-called the linearcompensations. The degree of adjustment or compensation e2(δx,δy)between f3 and g3 comes to be indicated by the following equation (Eq.9) when applying the “sum of squires of the differences”.e2(δx,δy)=ΣΣ(f3(x,y)−g3(x,y)²  (Eq. 9)

The above ΣΣ is the sum within the division unit area. A purpose of theposition shift detector portion 442 for the each division unit,detecting it in the sub-pixel unit, is to obtain the values of δx andby, i.e., δx0 and δy0 with which the e2(δx,δy) takes the minimum valuewithin the division unit area. For that purpose, the equation (Eq. 9)mentioned in the above is differentiated with partial differentiation byδx and δy and is put to be equal 0, to be solved with respect to δx andδy. The result comes to be indicated by the equations (Eq. 10) and (Eq.11) as follows.δx0={(ΣΣC0*Cy)*(ΣΣCx*Cy)−(ΣΣC0*Cx)*(ΣΣCy*Cy)/}(ΣΣCx*Cx)*(ΣΣCy*Cy)−(ΣΣCx*Cy)*(ΣΣCx*Cy)  (Eq.10)δy0={(ΣΣC0*Cx)*(ΣΣCx*Cy)−(ΣΣC0*Cy)*(ΣΣCx*Cx)/}(ΣΣCx*Cx)*(ΣΣCy*Cy)−(ΣΣCx*Cy)*(ΣΣCx*Cy)  (Eq.11).

Where, the above C0, Cx, and Cy are in the relationships shown by thefollowing equations (Eq. 12), (Eq. 13) and (Eq. 14).C0=f2(x,y)−g2(x,y)  (Eq. 12)Cx={f2(x+1,y)−f2(x,y)}−{g2(x−1,y)−g2(x,y)}  (Eq. 13)Cy={f ²(x,y+1)−f2(x,y)}−{g2(x,y−1)−g2(x,y)}  (Eq. 14)

For obtaining each of δx and δy, as shown in the (Eq. 10) and (Eq. 11)mentioned above, there is necessity of obtaining the various statistical(total) quantity of ΣΣCk*Ck (however, Ck=C0, Cx, Cy) mentioned above.The statistical quantity calculating portion 443, bridging over thedivision unit, calculates the above-mentioned various kinds ofstatistical quantities ΣΣCk*Ck on a basis of the detection image f2(x,y)of each division unit, consisting of the gradation value of eachdivision unit aligned by the pixel unit and obtained from the positionalignment unit 441 of each pixel unit, and the comparison (reference)image g2(x,y) of each division unit. The sub-CPU 444 executescalculation of the above equations (Eq. 10) and (Eq. 11) by using theΣΣCk*Ck which is calculated over the division units in the statisticalquantity calculating portion 443, so as to obtain δx0 and δy0.

Delay circuits 45 a and 45 b, each comprising a shift register and soon, are provided for delaying the image signals f2 and g2 by a timeperiod which is necessitated for obtaining the δx0 and δy0 in theposition shift detecting unit 442 for detecting the position shift ofthe each division unit in the sub-pixel unit.

Following to the above, a defect determining portion 64 for each one setof division units within defect determining portions 64 a–64 d for eachdivision unit shown in FIG. 1 will be explained by referring to FIG. 9.Within the division unit defect determining portion 64, while adifference image between the detection image f2 of the each divisionunit and the comparison image g2 of the each division unit being formedin a difference extracting circuit 461, a threshold value for each pixelis calculated in a threshold calculating circuit 462 for each divisionunit, and the difference image is compared with the threshold values inthe gradation values, thereby determining to be the defect or not, in athreshold value processing unit 463.

The difference extracting circuit 461 for the each division unit obtainsa difference image sub(x,y) for each division unit between the divisionunit detection image f2 and the division unit comparison image g2,having the position gaps 2*δx0 and 2*δy0 upon the calculation thereof.This difference image sub(x,y) of each division unit can be expressed bythe following equation (Eq. 15):sub(x,y)=g1(x,y)−f1(x,y)  (Eq. 15)

The threshold value calculating circuit 462 of each division unit localculates two threshold values thH(x,y) and thL(x,y) to determine to bethe defective candidate or not, by using the position shift quantitiesδx0 and δy0 of each division unit in the sub-pixel unit, which areobtained from the position shift detector portion 442 of the sub-pixelunit. The thH(x,y) is a threshold value for restricting an upper limitof the difference image sub(x,y) obtained for each division unit, andthe thL(x,y) a threshold value for restricting a lower limit of thedifference image sub(x,y) obtained for each division unit. Theconstruction of the threshold value calculating circuit 462 for eachdivision unit is shown in FIG. 12. The contents of the calculationswhich are executed in the threshold value calculating circuit 462 areexpressed by the following equations (Eq. 16) and (Eq. 17).thH(x,y)=A(x,y)+B(x,y)+C(x,y)  (Eq. 16)thL(x,y)=A(x,y)−B(x,y).−.C(x,y)  (Eq. 17)

However, the above A(x,y) can be expressed by the following equation(Eq. 18), and is a clause for compensation the threshold value dependingupon the value of the difference image sub(x,y) which can besubstantially obtained for each division unit by using the positionshift quantities δx0 and δy0 in sub-pixel unit which are obtained foreach division unit.

Also, the above B(x,y) can be the following equation (Eq. 19), and is aclause for allowing or tolerating a minute position shift at the patternedge (also, a minute differences in the pattern shape or in the patterndeformation can be treated as the minute position shift at the patternedge, from a local view point), between the detection image f2 obtainedfor each division unit and the comparison image g2 obtained for eachdivision unit. Further, the above C(x,y) can be the following equation(Eq. 20), and is a clause for allowing or tolerating a minute differencein the gradation value between the detection image f2 obtained for eachdivision unit and the comparison image g2 obtained for each divisionunit.

$\begin{matrix}\begin{matrix}{{A\left( {x,y} \right)} = {\left\{ {{{dx}\; 1\left( {x,y} \right)*\delta\;{x0}} - {{dx}\; 2\left( {x,y} \right)*\left( {{- \delta}\;{x0}} \right)}} \right\} +}} \\{\left\{ {{{dy}\; 1\left( {x,y} \right)*\delta\;{y0}} - {{dy}\; 2\left( {x,y} \right)*\left( {{- \delta}\;{y0}} \right)}} \right\}} \\{= {{\left\{ {{{dx}\; 1\left( {x,y} \right)} + {{dx}\; 2\left( {x,y} \right)}} \right\}*\delta\;{x0}} +}} \\{\left\{ {{{dy}\; 1\left( {x,y} \right)} + {{dy}\; 2\left( {x,y} \right)}} \right\}*\delta\;{y0}}\end{matrix} & \left( {{Eq}.\mspace{14mu} 18} \right) \\\begin{matrix}{{B\left( {x,y} \right)} = {{\left\{ {{{dx}\; 1\left( {x,y} \right)*\alpha} - {{dx}\; 2\left( {x,y} \right)*\left( {- \alpha}\; \right)}} \right\} } +}} \\{\left. \left\{ {{{dy}\; 1\left( {x,y} \right)*\beta} - {{dy}\; 2\left( {x,y} \right)*\left( {- \beta} \right\}}} \right. \right)} \\{= {{{\left\{ {{{dx}\; 1\left( {x,y} \right)} + {{dx}\; 2\left( {x,y} \right)}} \right\}*\alpha}} +}} \\{{{\left\{ {{{dy}\; 1\left( {x,y} \right)} + {{dy}\; 2\left( {x,y} \right)}} \right\}*B}}\mspace{11mu}}\end{matrix} & \left( {{Eq}.\mspace{14mu} 19} \right)\end{matrix}$C(x,y)=((max1+max2)/2)γ+ε  (Eq. 20)

where, α or β is a real number from 0 to 0.5, γ a real number beingequal or greater than 0, and ε an integer being equal or greater than 0.

The dx1(x,y) can be expressed by a relationship of the followingequation (Eq. 21) and indicates an amount of change in the gradationvalues on the detection image f2(x,y) obtained for each division unitwith respect to the image neighboring by +1 in the x direction.

And, the dx2(x,y) can be expressed by a relationship of the followingequation (Eq. 22) and indicates an amount of change in the gradationvalues on the comparison image g2(x,y) obtained for each division unitwith respect to the image neighboring by −1 in the x direction.

Further, the dy1(x,y) can be expressed by a relationship of thefollowing equation (Eq. 23) and indicates an amount of change in thegradation values on the detection image f2(x,y) obtained for eachdivision unit with respect to the image neighboring by +1 in the xdirection.

Furthermore, the dy2(x,y) can be expressed by a relationship of thefollowing equation (Eq. 24) and indicates an amount of change in thegradation values on the comparison image g2(x,y) obtained for eachdivision unit with respect to the image neighboring by −1 in the xdirection.dx1(x,y)=f2(x+1,y)−f2(x,y)  (Eq. 21)dx2(x,y)=g2(x,y)−g2(x−1,y)  (Eq. 22)dy1(x,y)=f2(x,y+1)−f2(x,y)  (Eq. 23)dy2(x,y)=g2(x,y)−g2(x,y−1)  (Eq. 24)

The max1 can be expressed by the following equation (Eq. 25), andindicates the maximum gradation value among the detection images,including the detection image f2(x,y) obtained for the each divisionunit itself and the images neighboring it by +1 in the x direction and+1 in the y direction. And, max2 can be expressed by the followingequation (Eq. 26), and indicates the maximum gradation value among thecomparison images, including the comparison image g2(x,y) obtained forthe each division unit itself and the images neighboring it by −1 in thex direction and −1 in the y direction.max1=max{f2(x,y),f2(x+1,y), f2(x,y+1); f2(x+1,y++1)}  (Eq. 25)max2=max{g2(x,y),g2(x−1,y), g2(x,y−1),g2(x−1,y−1)}  (Eq. 26)

First, an explanation will be given on the first clause, A(x,y) in theequations (Eq. 16) and (Eq. 17) for calculating the threshold values forthe each division, thH(x,y) and thL(x,y). Namely, the first clause,A(x,y) in the equations (Eq. 16) and (Eq. 17) for calculating thethreshold values thH(x,y) and thL(x,y) for the each division, is aclause for compensating the threshold value depending upon the positionshift quantities δx0 and δy0 for the each is division unit in thesub-pixel unit, which are obtained by the position shift detectingportion 442 for the each division unit in the sub-pixel unit. Forexample, since the dx1 which is expressed by the equation (Eq. 21)indicates a local changing rate in the x direction of the gradationvalues of the detection image f2 for the each division unit, thedx1(x,y)*δx0 for the division unit shown in the equation (Eq. 18) can besaid an estimation value of the gradation values of the f2 when theposition is shifted by δx0. Therefore, the first clause,{dx1(x,y)*δx0−dx2(x,y)*(−δx0)}+{dy1(x,y)*δy0−dy2(x,y)*(−δy0)} for theeach division unit shown in the equation (Eq. 18) can be said a value ofchange in the gradation values of the difference image between f2 andg2, which is estimated for the each pixel, when the position of f2 isshifted by δx0 in the x direction and δy0 in the y direction. Similarly,the second clause also can be said a value estimated but in the ydirection. Namely, the {dx1(x,y)+dx2(x,y)}*δx0 for the each divisionunit is the estimated value of change in the gradation values of thedifference image between f2 and g2 in the x direction, by multiplyingthe position shift δx0 with the local changing rate,{dx1(x,y)+dx2(x,y)}, in the x direction of the difference image betweenthe detection image f2 for the each division unit and the comparisonimage g2 for the each division unit, and the {dy1(x,y)+dy2(x,y)}*δy0 forthe each division unit is the estimated value of change in the gradationvalues of the difference image between f2 and g2 in the y direction, bymultiplying the position shift δy0 with the local changing rate,{dy1(x,y)+dy2(x,y)}, in the y direction of the difference image betweenthe detection image f2 for the each division unit and the comparisonimage g2 for the each division unit.

As explained in the above, the first clause, A(x,y) in the thresholdvalues thH(x,y) and thL(x,y) for the each division unit is the clausefor canceling the position shifts, δx0 and δy0 which are known inadvance for the each division unit.

Next, an explanation will be given on the second clause, B(x,y) in theequations (Eq. 16) and (Eq. 17) for calculating the threshold valuesthH(x,y) and thL(x,y) for the each division unit. Namely, the secondclause, B(x,y) in the equations (Eq. 16) and (Eq. 17) for calculatingthe threshold values thH(x,y) and thL(x,y) for the each division unit,is a clause for allowing or tolerating the minute position shift at thepattern edge of the each division unit (also, a minute differences inthe pattern shape or in the pattern deformation can be treated as theminute position shift at the pattern edge, from a local view point). Asis apparent from comparison between the equations (Eq. 18) and (Eq. 19)for obtaining the A(x,y) and the B(x,y), the later B(x,y) indicates anabsolute value of the estimated change in the gradation values of thedifference image by the position shifts α and β. If the position shiftcan be canceled by the A(x,y), the addition of B(x,y) to A(x,y) meansthat the position is shifted further by α in the x direction and β inthey direction from an aligned condition, by taking into theconsideration the minute position shift at the pattern edge due to theminute difference on the basis the form of the pattern, as well as thedeformation thereof. Namely, that for allowance or tolerance of +α inthe x direction and +β in the y direction, as the minute position shiftat the pattern edge due to the minute difference on the basis the formof the pattern, as well as the deformation thereof for the each divisionunit, is the clause +B(x,y) shown in the above-mentioned equation (Eq.16). Further, as is shown in the above equation (Eq. 17), thesubtraction of B(x,y) from A(x,y) means that the position is shiftedfurther by −α in the x direction and −β in the y direction from thealigned condition for the each division unit. That for allowing ortolerating −α in the x direction and −β in the y direction is the clause−B(x,y) shown in the above equation (Eq. 17). As indicated by theequations (Eq. 16) and (Eq.17), with provision of the upper limitthH(x,y) and the lower limit theL(x,y) in the threshold value for eachdivision unit, it is possible to allow or tolerate the position shift,by ±α and ±β for the each division unit. And, in the threshold valuecalculating circuit 462 for the each division unit, it is possible tocontrol the allowable or tolerable position shift quantity (the minuteposition shift at the pattern edge) due to the minute difference on thebasis of shapes of the patterns and the deformation thereof for eachdivision unit freely, by setting up the values of inputted parameters, αand β at appropriate values thereof.

Next, an explanation will be given on the third clause, C(x,y) in theequations (Eq. 16) and (Eq. 17) for calculating the threshold valuesthH(x,y) and thL(x,y) for each division unit. The C(x,y) in theequations (Eq. 16) and (Eq. 17) for calculating the threshold valuesthH(x,y) and thL(x,y) for the each division unit, is the clause forallowing or tolerating the minute difference in the gradation value,between the detection image f2 for the each division unit and thecomparison image g2 for the each division unit. As shown in the equation(Eq. 16), the addition of the C(x,y) means that the gradation value ofthe comparison image g2 for the each division unit is allowed to begreater than that of the detection image f2 for the each division unitby the C(x,y), while the subtraction of the C(x,y), as indicated by theequation (Eq. 17), means the gradation value of the comparison image g2for the each division unit is allowed to be smaller than that of thedetection image f2 for the each division unit by the C(x,y).

Although the C(x,y) is described here as the sum of a representativevalue (here, the max-value) of the gradation value in a local areamultiplied by a constant proportion y and the constant ε, as shown inthe equation (Eq. 20), there is no necessity of always relating to thatfunction. If the way of change in the gradation values is known, thefunction being fitted to that may be preferably applied to it. Forinstance, if an amplitude of the change is proportional to the squireroot of the gradation value, the function should be as the followingequation (Eq. 27) in place of the above equation (Eq. 20):C(x,y)=(√{square root over ((max1+max2)}*γ+ε)  (Eq. 27)

Further, it is also possible to provide a look-up table (LUT) of theC(x,y) with respect to- various representative values for the gradationvalues in advance, so as to output the C(x,y) once the representativevalue of the gradation value is input thereto. The LOT is preferable ina case where it is difficult to express the way of change by means ofsuch the function. And, in the threshold value calculating circuit 462for each division unit, similar in the B(x,y), it is also possible tocontrol the allowable or tolerable difference in the gradation value foreach division unit freely, by the parameters γ and ε to be inputted.

As shown in FIG. 12, the threshold value calculating circuit 462 foreach division unit comprises a calculation circuit 91 for executing acalculation, i.e., dx1(x,y)+dx2(x,y)}, on a basis of the detection imagef2(x,y) for each division unit inputted from the delay circuit 45 andthe comparison image g2(x,y) for each division unit, a calculationcircuit 92 for executing a calculation, i.e., {dy1(x,y)+dy2(x,y)}, and acalculation circuit 93 for executing a calculation, i.e., (max1+max2).

Further, a calculation circuit 94 executes a calculation on a basis of{dx1(x,y)+dx2(x,y)} obtained from the calculation circuit 91 for eachdivision unit, δx0 obtained from the detector portion 442 in sub-pixelunit for each division unit, and the parameter a to be inputted, i.e.,({dx1(x,y)+dx2(x,y)}*δx0 ±|{dx1(x,y)−dx2(x,y)}|*α as a portion of theequation (Eq. 18) and a portion of the equation (Eq.19). A calculationcircuit 95 executes a calculation on a basis of {dy1(x,y)+dy2(x,y)}obtained from the calculation circuit 92 for each division unit, δy0obtained from the detector portion 44 in the sub-pixel unit for eachdivision unit, and the parameter β to be inputted, i.e.,({dy1(x,y)+dy2(x,y)}*δy0±|{dy1(x,y)+dy2(x,y)}|*β as a portion of theequation (Eq. 18) and a portion of the equation (Eq. 19). A calculationcircuit 96 executes a calculation on a basis of the (max1+max2) obtainedfor each division unit from the calculation circuit 93, the inputtedparameters γ and ε, i.e., ((max1+max2)/2)*γ+ε, following the equation(Eq. 20) for example.

Further, the threshold value calculation circuit 462 comprises anaddition circuit 98 for outputting the threshold value thH(x,y) at theupper limit by summing ({dx1(x,y)+dx2(x,y)}*δx0+|{dx1(x,y)+dx2(x,y)}|*α)obtained from the calculation circuit 94,({dy1(x,y)+dy2(x,y)}*δy0+|{dy1(x,y)+dy2(x,y)}|*β) obtained from thecalculation circuit 95, and ((max1+max2)/2)*γ+ε) obtained from thecalculation circuit 96, a subtraction circuit 97 for subtracting by((max1+max2)/2)*γ+ε) obtained from the calculation circuit 96, andaddition circuit 99 for outputting the threshold value thL(x,y) at thelower limit by summing ({dx1(x,y)+dx2(x,y)}*δx0−|{dxl(x,y)+dx2(x,y)}|*α)obtained from the calculation circuit 94,({dyl(x,y)+dy2(x,y)}*δy0−|{dy1(x,y)+dy2(x,y)}|*β) obtained from thecalculation circuit 95, and −((max1+max2)/2)*γ+ε) obtained from thesubtraction circuit 97.

However, it is preferable that the parameters α, β, γ and ε to beinputted are prepared in a test parameter file in which the appropriatevalues of the parameters α, β, γ and ε are described for each kind ofthe inspection objects (i.e., for each variation of the wafers orprocesses), and that there is provided a such device with which the fileis automatically loaded when the inspection is started by inputting thevariation thereof.

The threshold value processing portion 463 for each division unitdecides or determines the pixel of a position (x,y) at a certaindivision unit to be the non-defective candidate if it satisfies therelationship of the following equation (Eq. 28), while to be thedefective candidate if it does not satisfy it, by using the differenceimage sub(x,y) obtained from the difference image extracting circuit(difference extracting circuit) 461, the threshold value thL(x,y) at thelower limit and the threshold value thH(x,y) at the upper limit for eachdivision unit, which are obtained from the threshold value calculationcircuit 462 for each division unit. The threshold value processingportion 463 for each division unit outputs a bi-valued or digitizedimage def(x,y) having “0” for the non-defective candidate and “1” forthe defective candidate in a certain division unit.ThL(x,y)≦sub(x,y)≦thH(x,y)  (Eq. 28)

In the defect compiling portions 47 a, 47 b, 47 c and 47 d for eachdivision unit in FIG. 1, after removing a noise-like output (forinstance, all of 3×3 pixels are not defective candidate pixels at thesame time) by a noise removing process (for instance,shrinking/expanding is executed with respect-to the digitized imagedef(x,y)). For example, when all of 3×3 pixels are not the defectivecandidates at the same time, the shrinking process is executed by makingonly the central pixel of them such as “0” (the non-defective candidatepixel) for removing them, and the expanding is executed for turning itback again), a merge process for the defective candidate portion isexecuted by collecting the neighboring defective candidate portions.After that, in the each division unit, characteristic quantity 88 iscalculated for each unity of the defective candidate portion collected,such as the position coordinates for the center of gravity, projectionlengths (indicating the maximum lengths in the x and y directions.However, the squire root of (squire of X projection length+Y projectionlength) comes to be the maximum length), areas thereof and so on, to beoutputted into the total controller portion 104.

As is explained in the above, from the image processing portion 103 awhich is controlled by the total controller portion 104, thecharacteristic quantity 88 (such as, the coordinate position for thecenter of gravity, the XY projection lengths, the area, etc.) of theeach defective candidate is obtained.

In the total controller portion 104, the position coordinates of thedefective candidate on the detection image are converted into thecoordinate system on the object 100 to be inspected (i.e., the sample)and are executed with removal of the suspected defects, and finally arecompiled as defect data, consisting of the position on the object 100 tobe inspected (i.e., the sample) and the characteristic quantities whichare calculated from the defect compiling portions 47 a, 47 b, 47 c and47 d for each division unit in the image processing portion 103 a.

According to the present embodiment, since the defect determination isexecuted after the detection image is divided into such the size thatthe image distortion or deformation can be neglected therefrom andcompensated with the position shift for each division unit, it ispossible to prevent from bringing or occurring a false or wrong reportwhich is often caused by the image deformation. Further, since theminute position shift at the each pattern edge and/or the minutedifference in the gradation values can be allowed or tolerated, it isfree from the error of recognizing the normal portion as the defect.Further, by setting up the parameters α, β, γ and ε at the appropriatevalues thereof, it is also possible to control the allowable ortolerable quantity or amount in the change of the position shift and thegradation values with ease.

However, in the explanation in the above, the thH(x,y) is obtained byadding A(x,y) to B(x,y)+C(x,y) (see the equation (Eq. 16)), whileobtaining thL(x,y) by subtracting B(x,y)+C(x,y) from A(x,y) (see theequation (Eq. 17)). However, in place of this, it is also possible touse the following equations (Eq. 29) and (Eq. 30):thH(x,y)=√{square root over (A(x,y)+{B(x,y)+C(x,y)})}{square root over(A(x,y)+{B(x,y)+C(x,y)})}{square root over(A(x,y)+{B(x,y)+C(x,y)})}  (Eq. 29)thL(x,y)=√{square root over (A(x,y)−{B(x,y)+C(x,y)})}{square root over(A(x,y)−{B(x,y)+C(x,y)})}{square root over(A(x,y)−{B(x,y)+C(x,y)})}  (Eq. 30)

With those equations (Eq. 29) and (Eq. 30), through the hardware comesto be large in the scale thereof, but if the minute position shift ateach the pattern edge and the change of gradation values are independentin phenomena, rather the equations (Eq. 29) and (Eq. 30) are inconformity with those, realistically, thereby obtaining the higherperformance or capacity.

Further, although the equations (Eq. 18), (Eq. 19) and (Eq. 20) are usedas a method for calculating A(x,y), B(x,y) and C(x,y) here, there alsomay be various calculating methods other than that. According to thepresent invention, those various methods also can be involved therein.

<Option Function of the First Embodiment>

The pattern inspection apparatus according to the present inventionincludes the following optional functions for supporting the inspectionother than the pattern inspection function which was mentioned in theabove.

(1) Input of Detection Image:

The image data, being started from a point at desire startingcoordinates for picking up the image, which is inputted from the inputmeans 146, etc., is stored into the memory 147, therefore there can beprovided a function that it is inputted into the computer providedwithin the total controller apparatus 104 or a higher ranked computerconnected to the total controller apparatus 104 through the network, orthat it is displayed on the display means 148 such as a display.Further, it is also possible to obtain the image data under a conditionwhere all or a part of the functions of the preprocessing circuit 40 isturned into OFF.

(2) Image Processing Means on the Computer:

The computer which is provided within the total controller apparatus 104or the higher ranked computer connected to the total controllerapparatus 104 through the network, has the following image processingfunctions:

a. production/display function of histogram of the image and/orcalculation/display function of image of cross-section.

With those functions, it is possible for the user to decideappropriateness of various image compensation in the pre-processingcircuit 40, or to set up an optimum condition (for example, accelerationvoltage value, beam current value, coefficient for aberrationcompensation, off-set value for auto-focusing, etc.) by comparing theimages which changes when adjusting the conditions of the electron opticsystem of the image pickup portion 102 variously.

b. Function of Measuring Deforming Condition in Image:

This is a function of measuring the deformation or distortion in theimage so as to display a deforming condition for each coordinates on thedisplay, or to teach also amplitude and/or frequency, etc., of thedeformation, if necessary. As mentioned previously, with the presentinspecting apparatus, the inspection of the deformed image is achievedor realized by dividing the image into the size so that the deformationthereof can be neglected therefrom. However, the condition of thedeformation differs depending upon the materials or sizes of the testobject, or the deformation at the issue also differs upon the inspectionefficiency or property which is needed. The present function is usefulto decide the way to divide it (though there is an upper limit in themaximum pixel number for dealing with each division unit due to theconstruction of the hardware, however, it is so constructed that it canbe set up freely as far as it is less than that).

c. Test Inspection Function:

This is a function to realize a comparison inspection being similar tothat executed in the image processing portion 103 on the computer. Withthis function, it is possible for the user to obtain an optimum value bytrying to change the inspection results, in particular, when the way ofdivision is changed and/or adjusted with the various inspectionparameters. In the case of the electron optic system, since there is noguarantee in that an equal image always can be obtained (due toinfluences of charge-up and/or contamination, etc.), it is impossible,without this function, to see the influence upon the inspection resultswhich are purely brought by those inspection parameters. Further, it hasanother function of displaying an image, not only a final inspectionresult, but also an image at a middle stage, such as the image beforethe position shift compensation or the difference image, etc.

<First Variation of the First Embodiment>

A first variation of the first embodiment of the pattern inspectingmethod and the apparatus thereof according to the present invention willbe shown in FIG. 13. Although the change in gradation values due to theposition shift of the sub-pixel unit is estimated for each division unitto be introduced into the threshold value in the present firstembodiment shown in FIG. 9, however, in the present first variation, animage aligned in the position is produced in the position shiftcompensation portion 464 for each division unit, by using the positionshift quantities, δx0 and δy0, which are obtained as the results of theposition shift detection in the sub-pixel unit for each division unit,in place of estimation of the change in the gradation value. In theposition shift compensation portion 464 for each division unit, thereare produced an image f3(x,y) obtained by shifting the detection imagef2(x,y) by δx0 in the x direction and δy0 in the y direction, which isobtained by aligning the position in the pixel unit for each divisionunit according to the following equation (Eq. 31), and an image g3(x,y)obtained by shifting the comparison image g2(x,y) by −δx0 in the xdirection and −δy0 in the y direction, which is obtained by aligning theposition in the pixel unit for each division unit according to thefollowing equation (Eq. 32).

$\begin{matrix}\begin{matrix}{{{f3}\left( {x,y} \right)} = {{{f2}\left( {{x + {dxo}},{y + {dyo}}} \right)} = {{\left( {1 - {dx0}} \right)\left( {1 - {dy0}} \right){{f2}\left( {x,y} \right)}} +}}} \\{{{{dx0}\left( {1 - {dyo}} \right)}{{f2}\left( {{x + 1},y} \right)}} + {\left( {1 - {dx0}} \right){{dy0f2}\left( {x,{y + 1}} \right)}} +} \\{{dx0dy0f2}\left( {{x + 1},{y + 1}} \right)}\end{matrix} & \left( {{Eq}.\mspace{11mu} 31} \right) \\\begin{matrix}{{{g3}\left( {x,y} \right)} = {{{g2}\left( {{x - {dx0}},{y - {dy0}}} \right)} = {{\left( {1 - {dx0}} \right)\left( {1 - {dy0}} \right){{g2}\left( {x,y} \right)}} +}}} \\{{{{dx0}\left( {1 - {dy0}} \right)}{{g2}\left( {{x - 1},y} \right)}} + {\left( {1 - {dx0}} \right){{dy0g2}\left( {x,{y - 1}} \right)}} +} \\{{dx0dy0g2}\left( {{x - 1},{y - 1}} \right)}\end{matrix} & \left( {{Eq}.\mspace{11mu} 32} \right)\end{matrix}$

The above equations (Eq. 31) and (Eq. 32) are for the purpose of aso-called hyperbola compensation. Though lowering a little bit inaccuracy, it is also possible to use the linear compensation indicatedby the equations (Eq. 7) and (Eq. 8) mentioned in the above, in place ofthose equations (Eq. 31) and (Eq. 32). Alternatively, other compensationmethods than the hyperbola compensation and the linear compensation alsocan be applied thereto.

The difference extracting circuit 466 for each division 20 unit obtainsan absolute value image diff(x,y) of the difference between thedetection image f2 and the comparison image g2 for each division unitwhich are compensated in the position shift compensation portion 464 foreach division unit. This absolute value image diff(x,y) can be expressedby the following equation (Eq. 33).diff(x,y)=|g 3(x,y)−f 3(x,y)|  (Eq. 33)

The threshold value calculation circuit 465 for each division unitcalculates the threshold value th(x,y) for judging or deciding to be thedefective candidate or not for each division unit by using the images f3and g3 which are compensated in the position shift compensating portion464 for each division unit. The contents of calculation in the thresholdvalue calculation circuit 465 for each division unit is expressed by thefollowing equation (Eq. 34).th(x,y)=B(x,y)+C(x,y)  (Eq. 34)

Though B(x,y) could be same to that in the equation (Eq. 19) (in thiscase, but f2 and g2 must be changed to f3 and g3 in the equations (Eq.21), (Eq. 22), (Eq. 23) and (Eq. 24)), however, it is calculated by thefollowing equation (Eq. 35) here. Also, C(x,y) could be same to that inthe equation (Eq. 20) (in this case, but f2 and g2 must be changed to f3and g3 in the equations (Eq. 25) and (Eq. 26)), however, it iscalculated by the following equation (Eq. 36) here.B(x,y)=[{max f(x,y)−min f(x,y)}/2+{maxg(x,y)−min g(x,y)}/2]/2xa  (Eq.35)C(x,y)=((f3(x,y)+g3(x,y))/2)×b+c  (Eq. 36)where, “a” is a real number from 0 to 0.5, “b” a real number greaterthan 0, and “c” an integer greater than 0.

However, maxf(x,y) is the maximum value among 3×3 pixels in the vicinityof f3(x,y) presented in the following equation (Eq. 37), minf(x,y) isthe minimum value among 3×3 pixels in the vicinity of f3(x,y) presentedin the following equation (Eq. 38), maxg(x,y) is the maximum value among3×3 pixels in the vicinity of g3(x,y) presented in the followingequation (Eq. 39), and minf(x,y) is the minimum value among 3×3 pixelsin the vicinity of g3(x,y) presented in the following equation (Eq. 40).

$\begin{matrix}\begin{matrix}{{\max\;{f\left( {x,y} \right)}} = {\max - \left\{ {{{f3}\left( {{x - 1},{y - 1}} \right)},{{f3}\left( {x,{y - 1}} \right)},} \right.}} \\{{{f3}\left( {{x + 1},{y - 1}} \right)},{{{f3}\left( {{x - 1},y} \right)}{{f3}\left( {x,y} \right)}},{{f3}\left( {{x + 1},y} \right)},} \\\left. {{{f3}\left( {{x - 1},{y + 1}} \right)},{{f3}\left( {x,{y + 1}} \right)},{{f3}\left( {{x + 1},{y + 1}} \right)}} \right\}\end{matrix} & \left( {{Eq}.\mspace{11mu} 37} \right) \\\begin{matrix}{{\min\;{f\left( {x,y} \right)}} = {\min\left\{ {{{f3}\left( {{x - 1},{y - 1}} \right)},{{f3}\left( {x,{y - 1}} \right)},} \right.}} \\{{{f3}\left( {{x + 1},{y - 1}} \right)},{{{f3}\left( {{x - 1},y} \right)}{{f3}\left( {x,y} \right)}},{{f3}\left( {{x + 1},y} \right)},} \\\left. {{{f3}\left( {{x - 1},{y + 1}} \right)},{{f3}\left( {x,{y + 1}} \right)},{{f3}\left( {{x + 1},{y + 1}} \right)}} \right\}\end{matrix} & \left( {{Eq}.\mspace{11mu} 38} \right) \\\begin{matrix}{{\max\;{g\left( {x,y} \right)}} = {\max\left\{ {{{g3}\left( {{x - 1},{y - 1}} \right)},{{g3}\left( {x,{y - 1}} \right)},} \right.}} \\{{{g3}\left( {{x + 1},{y - 1}} \right)},{{g^{3}\left( {{x - 1},y} \right)}{{g3}\left( {x,y} \right)}},{{g3}\left( {{x + 1},y} \right)},} \\\left. {{{g3}\left( {{x - 1},{y + 1}} \right)},{{g3}\left( {x,{y + 1}} \right)},{{g3}\left( {{x + 1},{y + 1}} \right)}} \right\}\end{matrix} & \left( {{Eq}.\mspace{11mu} 39} \right) \\\begin{matrix}{{\min\;{g\left( {x,y} \right)}} = {\min\left\{ {{{g3}\left( {{x - 1},{y - 1}} \right)},{{g3}\left( {x,{y - 1}} \right)},} \right.}} \\{{{g3}\left( {{x + 1},{y - 1}} \right)},{{{g3}\left( {{x - 1},y} \right)}{{g3}\left( {x,y} \right)}},{{g3}\left( {{x + 1},y} \right)},} \\\left. {{{g3}\left( {{x - 1},{y + 1}} \right)},{{g3}\left( {x,{y + 1}} \right)},{{g3}\left( {{x + 1},{y + 1}} \right)}} \right\}\end{matrix} & \left( {{Eq}.\mspace{11mu} 40} \right)\end{matrix}$

First, an explanation will be given on the first clause, B(x,y) in theequation (Eq. 34), for calculating the threshold value th(x,y) for eachdivision unit. The portion, F=(maxf(x,y)−minf(x,y))/2 in the equation(Eq. 35) represents the changing rate of the gradation values (i.e.,change in the gradation value per one pixel) in the 3×3 pixels in thevicinity of the detection image f3(x,y) compensated by the positionshift compensation portion 464 for each division unit, and the portion,G=(maxg(x,y)−ming(x,y))/2 represents the changing rate of the gradationvalue (i.e., change in the gradation value per one pixel) in the 3×3pixels in the vicinity of the comparison image g3(x,y) compensated bythe position shift compensation portion 464 for each division unit,therefore, the [F+G]/2 before being multiplied by “a” comes to be anaverage of the changing rates in the gradation values of f3(x,y) andg3(x,y). Accordingly, the B(x,y) obtained by multiplying the [F+G]/2 by“a” can be interpreted as an estimated value of change in the absolutevalue image diff(x,y) of the difference, which is caused by the positionshift “a”. Namely, the B(x,y) which can be represented by the equation(Eq. 35) means, in similar to the B(x,y) represented by the equation(Eq. 19), that it allows the “a” as the minute position shift at thepattern edge. And, as the a and, did in the equation (Eq. 19), it ispossible to control the allowable or tolerable amount or quantity freelyby this “a”.

Next, an explanation will be given on the second clause, C(x,y) in theequation (Eq. 34) for calculating the threshold value th(x,y) for eachdivision unit. The portion, (f3(x,y)+g3(x,y))/2, though needless to say,but it is an average of the gradation values at the coordinates (x,y) ofthe detection image f3 and the comparison image g3, which are obtainedfrom the position shift compensation portion 464 for each division unit.Therefore, since the C(x,y)=(f3(x,y)+g(x,y))/2)xb+c changes dependingupon the average in the gradation values of the both images, it can besaid, in similar to the C(x,y) represented by the -equation (Eq. 20),that it is also the clause which changes the allowable or tolerableamount or quantity in the absolute value image diff(x,y) of thedifference depending upon the gradation values. Here, the C(x,y) isdescribed as the value obtained by multiplying the representative one ofthe gradation values (here, the average value) by the proportionconstant “b” and adding the constant “c” thereto, however, in thesimilar manner as is mentioned in the explanation on the equation (Eq.17), it should be substituted with a function fitting to the way ofchange in the gradation values if it is known in advance Further, as they and s did in the equation (Eq. 17), it is also possible to control theallowable or tolerable amount or quantity freely by this “b” and “c”.The construction of the threshold value calculating circuit 465 for eachdivision unit is shown in FIG. 14. As is shown in FIG. 14, the thresholdvalue calculating circuit 465 comprises a calculation circuit 4651 forexecuting a calculation, i.e.,[maxf(x,y)−minf(x,y)+maxg(x,y)−ming(x,y)}, and a calculation circuit4652 for executing a calculation, i.e., [f3(x,y)+g3(x,y)]. A calculationcircuit 4653 executes a calculation on the basis of(maxf(x,y)−minf(x,y)+maxg(x,y)−ming(x,y)] inputted from the calculationcircuit 4651 and a parameter “a′=a/4” to be inputted, i.e.,[{maxf(x,y)−minf(x,y)+maxg(x,y)−ming(x,y)}xa′]. Namely, it obtains theB(x,y) in accordance with the equation (Eq. 35). And, a calculationcircuit 4654 executes the calculation on the basis of [f3(x,y)+g3(x,y)]inputted from the calculation circuit 4652 and parameters “b′=b/2” and“c” to be inputted, i.e., [(f3(x,y)+g3(x,y))xb′+c]. Namely, it obtainsthe C(x,y) in accordance with the equation (Eq. 36).

Further, the threshold value calculating circuit 465 for each divisionunit comprises an addition circuit 4655 for adding[{maxf(x,y)−minf(x,y)+maxg(x,y)−ming(x,yfl−xa′] obtained from thecalculation circuit 4653 and [(f3(x,y)+g3(x,y))xb′+c] obtained from thecalculation circuit 4654, so as to output as the threshold value th(x,y)at the upper limit.

A threshold value processing portion 467 for each division unit decidesthe pixels at the position (x,y) for each division unit to be thenon-defective candidate if both the absolute value image diff(x,y) ofthe difference obtained for each division unit from the difference imageextracting circuit 466 for each division unit and the threshold valueth(x,y) obtained for each division unit from the threshold valuecalculation circuit 465 for each division unit satisfy a relationshipwhich is represented by the following equation (Eq. 41), while thepixels at the position (x,y) to be defective candidate if they do notsatisfy it. The threshold value processing portion 467 for each divisionunit outputs the digitized image def(x,y), having “0” for thenon-defective candidate pixels and “1” for the defective candidatepixels, respectively.diff(x,y)≦th(x,y)  (Eq. 41)

The first variation mentioned in the above is same to that of the firstembodiment in an aspect that the defect determination is executed afterthe detection image is divided into such the size that the imagedeformation can be neglected therefrom and is compensated in theposition shift for each division unit. Accordingly, it is also possibleto prevent from bringing about or occurring the false or wrong reportswhich are caused by the image deformation or distortion.

Further, since the minute positions shift at the each pattern edgeand/or the minute difference in the gradation values can be allowed, itis also same that it is free from the error of recognizing the normal(or non-defective) portion as the defect, and it is possible to controlthe allowable or tolerable quantity or amount in the change of theposition shift and the gradation values with ease, by setting up theparameters a, b and c at appropriate values thereof.

<Second Variation of the First Embodiment>

A second variation of the first embodiment of the pattern inspectingmethod and the apparatus thereof according to the present invention willbe shown in FIG. 15. A difference to the first embodiment shown in FIG.9 lies in that there is provided a gradation compensation portion 445for compensating the gradation values of the detection image f2 and thecomparison image g2 after the position alignment in the pixel unit isdone in the position alignment portion 441 in the pixel unit for eachdivision unit.

In the gradation compensation portion 445 are obtained an average valueavgF of the gradation values in the detection image f2 for each divisionunit and a standard or reference deviation sigmaF thereof, i.e., theaverage value avgG of the gradation values in the comparison image g2for each division unit and the standard deviation sigmaG thereof, andthey are converted into the gradation value of the comparison image g2for each division unit, according to the following equation (Eq. 42):g4(x,y)=(sigmaF/sigmaG)×(g2(x,y)−avgG)+avgF  (Eq.42)

Namely, according to the equation (Eq. 42), the g2 is converted into animage g4 having the average value avgF and the standard deviationsigmaF. On a while, the detection image f2 is outputted as it is withoutany change thereto. Namely, f4(x,y)=f2(x,y). Accordingly, the f2 and theg2, each having the average value and the standard or referencedeviation being different to each other, come to the images f4 and theg4 being equal to each other in the average value and the standard orreference deviation thereof through the gradation compensation portion445. And, since the f4 and g4 are aligned in the position in theaccuracy of the pixel unit inherently, it is almost equal to that thegradation values of the both are same as a whole, if the average valueand the standard deviation are made equal to each other.

Next, an explanation will be given on advantages of the second variationof the first embodiment.

Basically, the present invention relates to a method for deciding theposition having a great difference in the gradation values as to be thedefect by comparing the detection image and the comparison image foreach division unit. Therefore, it is assumed that the detection imageand the comparison image for each division unit are equal to each otherin the gradation values at the position other than that of the defect.However, the detection image and the comparison image for each divisionunit may actually differ to each other in the gradation values of theimage as a whole, because of the difference such as the time ofdetecting the image and/or the position thereof. For instance, if thetiming of detection of the image differs, the number of electrons caughtby the electron detector 35 (see FIG. 1) varies depending upon thechange in the condition of electrical charge in the electron opticsystem or the inspection object itself, therefore, the gradation valuesof the image as a whole might be fluctuated up and down as shown in FIG.16 (a). Further, if the position for detecting image differs on theinspection object 100, the contrast of the pattern might be different asshown in FIG. 16 (b) due to the difference in the film thickness, etc.It can be said that FIG. 16 (a) shows the difference in the off-set andFIG. 16 (b) the difference in the gain, and either one or both(compound) of them can be compensated by the above equation (Eq. 42).

In general, the bigger the difference in the gradation values as awhole, the greater the difference in the timing of detecting the images,or the greater the distance between the positions of detecting theimages. Therefore, though it does not come to be a problem so much inthe “cell to cell Comparison Method” mentioned previously, however, itmight bring false reports often in a “die to die Comparison Method”, ormight cause mall- or miss-detection of the defects if loosing theinspection condition for reducing the possibility of the false reports.

As is apparent from the above, according to the present secondvariation, the gradation values are made equal between the detectionimage and the comparison image for each division unit by the gradationcompensation portion 445 provided for each division unit, thereforeenabling the inspection by comparison in more strict. And, this effectis remarkable, in particular with the “Chip Comparison Method”.

In the equation (Eq. 42), the distribution of the gradation values inthe comparison image g2 is made equal to that of the detection image f2for each division unit, however, the both of the detection image and thecomparison image for each division unit can be also adjusted orcompensated to fit to a standard or reference distribution of thegradation values by determining an average value and a reference valueof the standard deviation in advance. Further, the second variationexplained in the above can also be constructed as shown in FIG. 17,combining with the first variation mentioned pervasively.

Here, the equation (Eq. 42) is applied to as the compensation method forthe gradation, and in summary, it is important that there is included aprocess or a means for making the gradation values equal to each otheris between the comparison image and the detection image, however, thepresent invention should not be restricted to the equation (Eq. 42) andrather includes various cases where such the compensations for thegradation value are applied to.

<Third Variation of the First Embodiment>

A third variation of the first embodiment of the pattern inspectingmethod and the apparatus thereof according to the present invention willbe shown in FIG. 18. A difference to the first embodiment shown in FIG.9 lies in that, not detecting the position shift in the sub-pixel unitin the position shift detection portion 442 for each division unit againafter the completion of the position aligning by the pixel unit in theposition aligning portion 441 by the pixel unit for each division unit,it is so constructed that the position shift amount or quantity betweenf1(x,y) and g(x,y) can be calculated in the accuracy being finer orlower than the pixel (i.e., sub-pixel unit), through the compensationbetween or among arranged elements, by using an arrangement at analignment factor which is produced in a process or by means of obtainingthe shift amount or quantity of g1(x,y) so that the alignment factorbetween the detection image f1(x,y) and the comparison image g1(x,y)comes to be the maximum.

In the alignment factor arrangement production portion 446 for eachdivision unit, the alignment factor is calculated between the each imageobtained by shifting the comparison image g1(x,y) for each division unitby −n through n pixels in the x and y directions respectively, and thedetection image f1(x,y), thereby producing two-dimension arrangements(p,q) as shown in FIG. 19. As the alignment factor can be usedΣΣ|f1−g1|, ΣΣ(f1−g1)², or the correlation coefficient, etc., in theabove equation (Eq. 1). FIG. 19 shows the alignment factor arrangementin the case where n=4, and the alignment factor when the g1 is shiftedby −2 pixels in the x direction and by 3 pixels in the y direction. Thetwo-dimension arrangement s(p,q) produced by the alignment factorarrangement production portion 446 is outputted to the CPU 444.

In the CPU 444, first, a value p0 for p and a value q0 for q forobtaining the maximum values in the alignment factor (however, in thecase where ΣΣ|f1−g1| or ΣΣ(f1−g1)² is applied to, the value p0 for p andthe value q0 for q for obtaining the minimum value in them) arecalculated from the two-dimension arrangement s(p,q) which is inputtedfrom the alignment factor arrangement production portion 446 for eachdivision unit. Then, a parabolic curve is fitted with respect tos(p0−1,q0), s(p0,q0) and s(p+1,q0) so as to obtain a value p0+pδ wherethe parabolic curve takes the extreme value.

Here, pδ is a non-integer from −1 to +1(−1<pδ<+1). In the same manner,the parabolic curve is fitted with respect to s(p0−1,q0), s(p0,q0) ands(p+1,q0) so as to obtain the value q0+qδ where the parabolic curvetakes the extreme value(s). Here, also qδ is a non-integer from −1 to +1(−1<qδ<+1). The value p0+pδ is the position shift quantity in the xdirection between the detection image f1 and the comparison image g1 foreach division unit, which is obtained in the accuracy of the sub-pixelunit, and the value q0+qδ is the position shift quantity in the ydirection between the detection image f1 and the comparison image g1 foreach division unit, which is obtained in the accuracy of the sub-pixelunit.

The delay circuits 45 a and 45 b constructed with the shift registersand so on are for the purpose of delaying the image signals f1 and g1 bya time period which is necessary for obtaining the values p0+pδ andq0+qδ.

The position shift compensating portion 447 for each division unit inthe pixel unit obtains P0 and q0 from the CPU 444 so as to output thedetection image f1(x,y) obtained for each division unit as it was, whilethe comparison image g1(x,y) obtained for each division unit by shiftingit by (p0,q0). Namely, f5(x,y)=f1(x,y), and g5(x,y)=g1(x+p0,y+q0).

The defect decision portion 46 for each division unit same to that ofthe first embodiment shown in FIG. 9. Namely, in the defect decisionportion 46 for each division unit, while the difference image subbetween the detection image f5 and the comparison image g5 is producedin the difference extraction circuit 461 for each division unit, thethreshold values thH and thL with respect to each pixel for eachdivision unit are calculated in the threshold value calculation circuit462 so as to decide to be the defect or not by comparing the gradationvalues of the difference image sub and the threshold values thH and thLfor each division unit in the threshold processing portion 463 for eachdivision unit. However, as the position shift quantity of sub-pixel unitis used the pδ obtained from the CPU 444 for δx0, and the qδ obtainedfrom the CPU 444 for δy0.

Further, the position shift detection portion 44 for each division unitin the third embodiment mentioned in the above can be constructed as isshown in FIG. 20, by combining with the defect decision portion 46 foreach division unit in the previously-mentioned first embodiment shown inFIG. 13.

Here is described a method of using only five data, i.e., s(p0−1,q0),s(p0,q0), s(p0+l ,q0), s(p0,q0−1) and s(p0,q0+l) for obtaining theposition shift of the sub-pixel unit, however, the more the number ofdata to be utilized; the nearer the values pδ and go should bedetermined to the true values thereof. Further, by using a totaltendency of the two-dimensional arrangement in the alignment factor (forexample, the alignment factor has only one peak value or plural ones, orit is a flat-like without fluctuation thereof, etc.), it is conceivableto give a kind of restriction on the calculation of the values pδ andqδ. In this manner, with this third variation, the arrangement of thealignment factor is produced by the hardware, while the portion forcalculating the position shift by using thereof is carried out by thesoftware in the CPU 444, therefore the calculating method can be alteredeasily and it has a possibility of enabling the more intelligentprocessing.

For producing the two-dimensional arrangement of the alignment factorfor each division unit, there is described a method of producing theimage obtained by shifting the comparison image g1(x,y) for eachdivision unit by −n through n pixels in the x and y directions so as toobtain the alignment factor respectively, however, the two-dimensionalarrangement of the correlation coefficient also can be obtained, byusing Fourier transformation image to f1(x,y) and g1(x,y), as below.

Assuming that two-dimensional discrete Fourier transform is described byF and a reverse transformation by F⁻¹, the Fourier transformation imageF1(s,t) of f1(x,y) and the Fourier transformation image G1(s,t) ofg1(x,y) can be described by the following equations (Eq. 43) and (Eq.44).F1(s,t)=F[f1(x,y)]  (Eq. 43)G1(s,t)=G[g1(x,y)]  (Eq. 44)

A cross power spectrum cps(s,t) of those can be 10 obtained by thefollowing equation (Eq. 45).cps(s,t)=F1(s,t)·G1(s,t)*  (Eq. 45)where, G1(s,t)* is a complex conjugate of G1(s,t). An mutual correlationimage corr(x,y) can be obtained by the reverse Fourier transformation ofcps(p,q), as shown by the following equation (Eq. 46).corr(x,y)=F ⁻¹ [cps(s,t)]  (Eq. 46)

This mutual correlation image corr(x,y) is the aimed two-dimensionalarrangement of the mutual correlation.

Process after having obtaining the two-dimensional arrangement of themutual correlation is as was mentioned previously. Assuming that thecoordinates at the maximum gradation value is (x0,y0) on the mutualcorrelation image corr(x,y), the position shift quantity is x0 in the xdirection by pixel unit and y0 in the y direction in the pixel unit.Namely, p0=x0 and q0=y0.

An advantage of using the Fourier transformation is in that the hardwarecan be small-sized in the scale thereof according to an occasion. Forexample, in a case of obtaining the respective alignment factors forg1(x,y) by shifting it ±4 pixels (n=4) in the x and y directionsrespectively, the arrangement elements of (4×2+1)²=81 (see FIG. 5 19)must be obtained simultaneously in order to the two-dimensionalarrangement of the alignment factors without time delay. Namely, it isnecessary that it has the image in which the positions of 81 are shiftedon the hardware. Comparing to this, in the case of using the Fouriertransformation, the scale of the hardware does not depend upon the “n”.If using the Fourier transformation, although the processing itselfbecomes complex, however it is considerably advantageous from a viewpoint of the scale of hardware, in particular in a case that the “n” islarge, i.e., is when a large position shift can be expected.

Further, for obtaining the mutual correlation image being sensitive tothe position shift (i.e., meaning that the mutual correlation imagehaving a sharp peak where the positions are aligned), the Fouriertransformation image can be transferred or converted into a productbetween Fourier amplitude image and Fourier phase image, wherein thecross power spectrum cps(s,t) is obtained by using only the Fourierphase image and is reverse-converted to obtain the mutual correlationimage corr(x,y).

Further, the third variation explained in the above can also beconstructed as shown -in FIG. 20, combining with the first variationmentioned pervasively.

<Fourth Variation of the First Embodiment>

A fourth variation of the first embodiment of the pattern inspectingmethod and the apparatus thereof according to the present invention willbe shown in FIG. 21. A difference to the first embodiment shown in FIG.9 lies in that, on the contrary to that the position shift quantity isobtained at the pitch of division unit so as to be used as the commonposition shift quantity (δx0, δy0) within division unit in the firstembodiment, however in this fourth variation, the position shiftquantities (δx0a, δy0a), (δx0b, δy0b), (δx0c, δy0c) and (δx0d, δy0d)obtained at the pitch of division unit are interpolated so as to obtainthe position shift quantity at the pitch of the pixel.

A concept of the fourth variation will be explained by referring to FIG.22. The black dots in FIG. 22 correspond to the position shiftquantities (δx0a, δy0a), (δx0b, δy0b), (δx0c, δy0c) and (δx0d, δy0d)obtained at the pitch of the division unit. In the first embodiment,thought the position shift quantity for each division unit is assumed tobe the common position shift quantity (δx0, δy0) in the sub-pixel unitwithin the division unit (thick line in the same figure), however, inthis fourth variation, the position shift quantity for each pixel isobtained by tying up the black dots with a smooth curved line (shown bya broken line). If making the division unit too small, the positionshift quantity cannot be determined since there is no pattern in theregion, therefore, those are interpolated once obtaining the positionshift quantity for each division unit having a predetermined size.

In FIG. 21, the processing in the position alignment portion 441 in thepixel unit for each division, and that in the statistical quantitycalculation portion 443 within the position shift detection portion 442in the sub-pixel unit for each division unit are same to those in thefirst embodiment. The sub-CPU 444 calculates the position shift quantity(δx0a, δy0a) for said the division unit by the above equations (Eq. 10)and (Eq. 11), and also obtains the position shift quantities (δx0b,δy0b), (δx0c, δy0c) and (δx0d, δy0d) for the other division unitsthrough the statistical quantity obtained from the other statisticalquantity calculation portion 443 not shown in the figure (Since in FIG.1 is shown the construction in the case of dividing the one scan intofour (4), here is also explained in the case of dividing it into four(4). If the number of the division is more than that, of course, thereare also obtained (δx0e, δy0e), (δx0f, δy0f)). After that, δx0a, δx0b,δx0c and δx0d are tied up with the smooth curved line, thereby obtainingthe position shift quantities in the x direction, zureXa(x,y),zureXb(x,y), zureXc(x,y) and zureXd(x,y), for respective pixels, so asto be written into a x-direction shift quantity table 448. Namely, intothe x-direction shift quantity table 448 is written the position shiftquantity zureX(x,y) in the x direction for each pixel, which is obtainedby tying up δx0a, δx0b, δx0c and δx0d with the smooth curved line (i.e.,zureXa(x,y) indicates the position shift quantity in the x direction,changing one by one for each pixel within the division unit 1,zureXb(x,y) indicates the position shift quantity in the x direction,changing one by one for each pixel within the division unit 2,zureXc(x,y) indicates the position shift quantity in the x direction,changing one by one for each—pixel within the division unit 3, andzurexd(x,y) indicates the position shift quantity in the x direction,changing one by one for each pixel within the division unit 4). Further,δy0a, δy0b, δy0c and δy0d are tied up with the smooth curved line,thereby obtaining the position shift quantities in the y direction,zureYa(x,y), zureYb(x,y), zureYc(x,y) and zureYd(x,y), for respectivepixels, so as to be written into a y-direction shift quantity table 449.Namely, into the y-direction shift quantity table 448 is written theposition shift quantity zureY(x,y) in the y direction for each pixel,which is obtained by tying up δy0a, δy0b, δy0c and δy0d with the smoothcurved line (i.e., zureYa(x,y) indicates the position shift quantity inthe y direction, changing one by one for each pixel within the divisionunit 1, zureYb(x,y) indicates the position shift quantity in the ydirection, changing one by one for each pixel within the division unit2, zureYc(x,y) indicates the position shift quantity in the y direction,changing one by one for each pixel within the division unit 3, andzureYd(x,y) indicates the position shift quantity in the y direction,changing one by one for each pixel within the division unit 4). Aso-called “B spline”, or approximation by a polynomial also can beapplied as the method for tying up with the smooth curved line. In thiscase of the fourth variation, the position shift detection portion 442of sub-pixel unit, which is constructed with the statistical quantitycalculation portion 443, the sub-CPU 444, the x-direction shift quantitytable 448, and the y-direction shift quantity table 449 can be used incommon.

Following to the above, an explanation will be given on the defectdecision portion 46 for each division unit. The following explanation isin common with all over the division units, therefore, the suffixes a,b, c, and d attached for distinction of the division units in the aboveexplanation will be omitted.

The delay circuits 45 a and 45 b, each comprising a shift register andso on, are provided for delaying the image signals f2 and g2 by a timeperiod which is necessitated for calculating out zureXa(x,y),zureXb(x,y), zureXc(x,y), zureXd(x,y), zureYa(x,y), zureYb(x,y),zureYc(x,y) and zureYd(x,y).

The difference extracting circuit 461 for each division unit, in thesame manner as in the first embodiment, obtains the difference imagesub(x,y) for each division unit between the division unit detectionimage f2 and the division unit comparison image g2 by the followingequation (Eq. 47).sub(x,y)=g1(x,y)−f1(x,y)  (Eq. 47)

The threshold value calculating circuit 462 of each division unitcalculates two threshold values thH(x,y) and thL(x,y) so as to determineto be the defective candidate or not, by using the position shiftquantities zureX(x,y) and zureY(x,y) of the sub-pixel unit, changing oneby one for each pixel, which are obtained from the position shiftdetecting portion 442 of sub-pixel unit at a certain division unit. ThethH(x,y) for each pixel unit is a threshold value for restricting anupper limit of the difference image sub(x,y) for each pixel unit, andthe thL(x,y) for each pixel unit a threshold value for restricting alower limit of the difference image sub(x,y) for each division unit,respectively. Those threshold values, in the same manner as in the firstembodiment, contains A(x,y) for substantially compensating the positionshift in the sub-pixel unit, B(x,y) for allowing or tolerating theminute position shift at the pattern edge, and C(x,y) for allowing ortolerating the minute difference in the gradation values, as shown inthe following equations (Eq. 48) and (Eq. 49).thH(x,y)=A(x,y)+B(x,y)+C(x,y)  (Eq. 48)thL(x,y)=A(x,y)−B(x,y)−C(x,y)  (Eq. 49)

The A(x,y) can be expressed by a relationship shown in the followingequation (Eq. 50). This is obtained by substituting δx0 in the equation(Eq. 18) by zureX(x,y) and δy0 by zureY(x,y).

$\begin{matrix}\begin{matrix}{{A\left( {x,y} \right)} = \left( {{{dx}\; 1\left( {x,y} \right)*{zureX}\left( {x,y} \right)} -} \right.} \\{\left. {{dx}\; 2\left( {x,y} \right)*\left( {- {{zureX}\left( {x,y} \right)}} \right)} \right\} +} \\{\left( {{{dy}\; 1\left( {x,y} \right)*{{zureY}\left( {x,y} \right)}} -}\; \right.} \\{\left. {{dy}\; 2\left( {x,y} \right)*\left( {- {{zureY}\left( {x,y} \right)}} \right)} \right\}\;} \\{= {{\left( {{{dx}\; 1\left( {x,y} \right)} + {{dx}\; 2\left( {x,y} \right)}} \right\}*{{zureX}\left( {x,y} \right)}} +}} \\{{\left( {{{dy}\; 1\left( {x,y} \right)} + {{dy}\; 2\left( {x,y} \right)}} \right\}*{{zureY}\left( {x,y} \right)}}\mspace{25mu}}\end{matrix} & \left( {{Eq}.\mspace{14mu} 50} \right)\end{matrix}$where, B(x,y) and C(x,y) are same to those in the first embodiment,therefore they can be obtained by the above equations (Eq. 19) and (Eq.20), respectively.

Also, the processing in the threshold value calculation portion 463 foreach division unit is same to that of the first embodiment. Namely, byusing the difference image sub(x,y) obtained from the difference imageextracting circuit (difference extracting circuit) 461 for each divisionunit, and also the lower limit threshold value thb(x,y) and the upperlimit threshold value thH(x,y) obtained from the threshold valuecalculating circuit 462 for each division unit, the image at theposition (x,y) in a certain division unit is outputted as the digitalimage def(x,y), having the value “0” for the non-defective candidate ifsatisfying the relationship of the above equation (Eq. 28), while havingthe value “1” for the defective candidate if not satisfying it.

Comparing this fourth variation to the first embodiment, in a case wherethe position shift quantity is changed within the division unit, adifference occurs between a center portion and a peripheral portion ofthe division unit in performance or capacity of detecting the defect inthe first embodiment. However, in this fourth variation, since theposition shift quantity within the divided area or region is obtainedfor each pixel with approximation, the value of A(x,y), i.e., the valuesof thH(x,y) and thL(x,y) are changed in accordance with the aboveequation (Eq. 50) on the basis of the obtained position shift quantitieszureX(x,y) and zureY(x,y) for each pixel, thereby showing an advantagethat the difference in the performance or capacity of detecting thedefect within the division unit can be mitigated.

In the explanation in the above, the interpolation is executed by usingthe position shift quantity which is calculated by making the divisionunit at the same timing as a one set (for example, the division unitshown by solid line in FIG. 8), however, it is also possible to use theposition shift quantity calculated by a next one set of the divisionunit (for example, the division unit shown by broken line in FIG. 8),further the position shift quantity calculated by an over-next one setof the division unit, as well, by extending the delay amount with thedelay circuit 45 as two times as large, three times . . . In this case,it is enough to obtain a curved surface tying those up in oblique fromthe arrangement thereof, aligning in two-dimensional manner.

Furthermore, this fourth variation explained in the above also can beconstructed as shown in FIG. 23, combining with the first variationmentioned pervasively. Also, this fourth variation explained in theabove can be constructed as shown in FIG. 24, combining with the secondvariation mentioned pervasively.

<Second Embodiment>

A second embodiment of the pattern inspecting method and the apparatusthereof according to the present invention will be shown in FIG. 25. Thepresent embodiment, as in the first embodiment shown in FIG. 1,comprises the detection portion 101, the image pick-out portion 102, theimage processing portion 103, and the total controller portion 104. Thedetection portion 101, the image pick-out portion 102 and the totalcontroller portion 104 are same to those of the first embodiment,therefore the explanation thereof is omitted here. The second embodimentis also same to the first embodiment described previously, as far as theimage is divided finely into such the size, so as to perform thedecision on the defect for each division unit, so that said the dynamicdeformation or distortion can be-neglected therefrom, as is shown inFIG. 7, for dealing with the dynamic deformation due to the change inthe magnetic field caused by the pattern distribution of the test object100 and/or the vibration of the stages 131 and 132, etc. The differenceto the first embodiment lies in that the image is divided into such thenegligible size gradually, but not from the beginning. For conveniencein explanation, the first embodiment is called as “a non-stepwisedivision method” is while the second embodiment as “a stepwise divisionmethod”.

First of all, a concept of the stepwise division method will explainedby referring to FIG. 26.

In the stepwise division method, the image is divided gradually andfinally into the size being same to that in the first embodiment,however, for distinction thereof, the division unit at the final iscalled as “small division unit”, at an earlier stage by one as “middledivision unit”, and at a stage earlier than that as “large divisionunit” . . . FIG. 26 shows the position coordinates on the horizontalaxis and the position shift quantities between the detection image andthe comparison image on the vertical axis. There are two positionshifts, i.e., the position shifts in the x direction and in the ydirection, however, FIG. 26 shows only one of them. If the change in theposition shift quantity is in such a profile as shown in FIG. 26,according to the non-stepwise division method, as is shown in (a) of thesame figure, investigation over ±n pixels (investigating the alignmentfactor within a range ±n pixels) is necessary for obtaining the positionshift quantity. On the contrary to this, according to the stepwisedivision method, as is shown in (b) of the same figure, since theposition shift is detected by the middle division unit in advance, it isenough the investigation at the small division unit be carried outfocusing on the position shift obtained at the middle division unit,thereby making the investigation range much smaller than ±n. This is theconcept of the stepwise division method.

The stepwise division method has two advantages as follows:

(1) Possibility of Reducing Hardware Scale.

Namely, the scale of the hardware is almost proportional to ((an area ofthe division unit)×(investigation range)²×(number of the divisionunit)). Assuming that the investigation range at the first stage is n1,at the second stage n2, and at the third stage n3 in the stepwisedivision method, the investigation range n in the non-stepwise divisionmethod should be roughly equal to the sum or total of the investigationranges at every stages in the stepwise division method. Namely, theinvestigation range n in the non-stepwise division method comes to be ina relation shown the following equation (Eq. 51).n=n1+n2+n3+ . . . +nt  (Eq.51)

In this instance, a ratio between the hardware scale of the stepwisedivision method and the hardware scale of the non-stepwise divisionmethod comes to be as shown by the following equation (Eq. 52), and itapparently is equal or less than 1.r=(n1² +n2² +n3² + . . . nt ²)/(n1+n2+n3+ . . . nt)²  (Eq. 52)

Namely, the stepwise division method is able to make the hardware scalesmall much more.

(2) High Possibility of Correct Position Shift Quantity.

Namely, the investigation range of the small division unit is still widein the non-stepwise division method, therefore there is possibility ofoccurring errors in the position alignment if the investigation rangeexceeds the pattern pitch. In FIG. 27, it is assumed that the smalldivision unit is the size as shown in FIG. 27 (a), the pattern pitch“d”, and the investigation range ±1.5 d. In this instance, an equalalignment factor can be obtained at a plurality of positions ifinvestigating the position fitting to the small division unit on thecomparison image, therefore there is possibility that it is aligned withan erroneous position. For instance in FIG. 27 (b), “position 1 to wherethe small division unit fits to” is correct, while “position 2 to wherethe small division unit fits to” is wrong, however, the calculationresult of the position shift quantity can be either of them. On a while,in the stepwise division method, the investigation in the small divisionunit is executed by focusing on the position where the positionalignment is done. Since the middle division unit is larger in the imagesize than the small division unit, a probability of including uniquepatterns therein is high, therefore, though the investigation is wide,but the possibility of the erroneous position alignment is low.Accordingly, with the small division unit, it is enough to investigate anarrow range by focusing only on the position where the positionalignment is correctly done, therefore the possibility of the erroneousposition alignment comes to be low or small. Even with this middledivision unit, there still can be a case where the erroneous positionalignment is done, in particular when no unique pattern is not involvedtherein, and/or when the investigation range is very large, however, itis apparent the possibility thereof is low comparing to the non-stepwisedivision method.

Next, an explanation will be given on the image processing portion 103 bby referring to FIGS. 25 through 29.

FIG. 25 shows the construction, where the position shift detection isconducted on the image without dividing thereof at the first stage, theimage is divided into two at the second stage, and each of them isfurther divided into two at the third stage, totally at the threestages. Namely, the horizontal width (the width in the x direction) ofthe large division unit is the scanning width itself, the width of themiddle division unit is about a half (½) or a little bit more of thescanning width, and the small division unit is about a quarter (¼) or alittle bit more of the scanning width. A positional relationship of eachdivision unit on the continuous image data is shown in FIG. 28 (a), (b)and (c). FIG. 28 (a) shows the large division unit, FIG. 28 (b) themiddle division unit, and FIG. 28 (c) the third division unit,respectively. Here, each division unit is overlapped with one another inthe same figure, as mentioned in the first embodiment, for the reason ofbringing about no gap nor shift in the detection area or region.

As shown in FIG. 25, the continuous image data f0(x,y) and g0(x,y),being outputted from the image pick-up portion 102, are stored into thetwo-dimension image memories 48 a and 48 b, respectively, in a certainscanning area (corresponding to the vertical width of the large divisionunit). Each of the two-dimension memories 48 a and 48 b is constructedwith the memory portion of two-dimension and the register for storingaddresses for start/end of writing, In the same manner as each of thetwo-dimension image memories 42 a and 42 b. Accordingly, in each ofthose two-dimension memories 48 a and 48 b, the coordinates of the largedivision unit (read start/end addresses) are set from the totalcontroller portion 104 into the registers for storing the read start/endaddresses, and the detection image data f7(x,y) and the comparison imagedata g7(x,y) are cut out from the two-dimension memory portions by thelarge division unit, so as to be read out therefrom. The position shiftdetecting portion 49, as shown in FIGS. 9 and 13, has the detectorportion 442 comprising the statistical quantity calculation portion 443and the sub-CPU 444, which obtains the position shift quantities δx2 andδy2 over the large division unit between the detection image f7(x,y) andthe comparison image g7(x,y), which are cut out and read out from theimage memories 48 a and 48 b for example, on the basis of the aboveequations (Eq. 5) and (Eq. 6) in the accuracy of the pixel unit, so asto be inputted into the position shift detector portion 51 a and 51 b,respectively. The above equations (Eq. 5) and (Eq. 6) are for the caseof calculating the position shift quantity in an unit larger than thepixel, wherein δx2 corresponds to mx0 and δy2 to my0. In the case ofcalculating the position shift quantity in the sub-pixel unit, they arebased upon the above equations (Eq. 10) and (Eq. 11). By changing theshift quantity mx in the x direction and the shift quantity my in the ydirection by ±0, 1, 2, 3, 4 n, in other words, shifting the comparisonimage g7(x,y) by the pixel pitches in the large division unit, thens1(mx,my)s are calculated on those occasions. And the values mx0 of mxand my0 of my are obtained, at which each of them comes to be theminimum. However, the maximum shift quantity n of the comparison imagemust to be a large value because of the large division unit.

Those δx2 and δy2 are the position shift quantities between thedetection image f7(x,y) and the comparison image g7(x,y) over the largedivision unit, in particular, δx2 is the position shift quantity overthe large division unit in the x direction and δy2 is the position shiftquantity over the large division unit in the y direction. During this,into the image memories 50 a and 50 b are written the detection imagef7(x,y) and the comparison image g7(x,y) of the large division unit,which are cut out and read out from those image memories 48 a and 48 b.However, as the method of calculating the position shift in the positionshift detector portion 49 can be applied either the method in theposition shift detector portion 44 of the first embodiment, or themethod in the position shift detector portion 44 of the third variationof the first embodiment, however, since there is no necessity ofobtaining the position shift quantity between the large division unitsin the accuracy of sub-pixel unit, those stages up to obtaining theposition shift in the accuracy of pixel unit are installed into thisposition shift detector portion.

The image memories 50 a and 50 b are also constructed in the same manneras the image memories 48 a and 48 b or the image memories 42 a and 42 bmentioned above. Accordingly, in each of those two-dimension memories 50a and 50 b, the coordinates of the middle division unit (read start/endaddresses) are set from the total controller portion 104 into theregisters for storing the read start/end addresses, and the detectionimage data f6 a(x,y) and 6 b(x,y) and the comparison image data g6a(x,y) and g6 b(x,y) are cut out from the two-dimension memory portionsby the middle division unit so as to be read out therefrom. The positionshift detecting portion 51 a obtains the position shift quantities δx1 aand δy1 a between the detection image f6 a(x,y) and the comparison imageg6 a(x,y) of the portion corresponding to the first middle divisionunit, which are cut out and read out from the image memories 50 a and 50b, on the basis of such as the above equations (Eq. 5) and (Eq. 6) inthe accuracy of the pixel unit, so as to be inputted into the positionshift detector portion 53 a and 53 b, respectively. Those δx1 a and δy1a are the position shift quantities over the first middle division unit.In synchronism with this, the position shift detector portion 51 bobtains the position shift quantities δx1 b and δy1 b between thedetection image f6 b(x,y) and the comparison image g6 b(x,y) of theportion corresponding to the second middle division unit, which are cutout and read out from the image memories 50 a and 50 b, on the basis ofsuch as the above equations (Eq. 5) and (Eq. 6) in the accuracy of thepixel unit, so as to be inputted into the position shift detectorportion 53 a and 53 b, respectively. Those δx1 a and δy1 a are theposition shift quantities over the second middle division unit. Thoseδx1 b and δx1 bcorrespond to mx0 and δy1 b and δy1 b to my0 in each ofthe first and second middle division units. With changing the shiftquantity mx in the x direction and the shift quantity my in the ydirection by ±0, 1, 2, 3, 4 n, respectively, in other words, shiftingthe comparison images g6 a(x,y) and g6 b(x,y) by the pixel pitches inthe first and the second middle division units, then s1(mx,my)s arecalculated on those occasions. And the values mx0 of mx and my0 of myare obtained, at which each of the comes to be the minimum. Namely, themaximum shift quantity n of the comparison image in the respectiveposition shift detector portions 51 a and 51 b can be narrowed very muchdepending upon the values δx2 and δy2 obtained from the position shiftdetection portion 49 in the large division unit, thereby enabling thehardware scale and the processing time to be minimized. However, in acase where the position shift quantities can be obtained in the accuracyof the pixel unit for the large division unit, it is also possible toobtain the position shift quantities δx1 a and δy1 a and δx1 b and δy1 bin the accuracy of the sub-pixel unit too, on the basis of the aboveequations (Eq. 10) and (Eq. 11) in the respective position shiftdetector portions 51 a and 51 b. And, during the position shiftdetection is executed in each of the position shift detection portions51 a and 51 b, into the image memories 52 a, 52 b and 52 c and 52 d arewritten the detection image f6 a and f6 b and the comparison image g6 aand g6 b of the middle division unit, respectively, which are cut outand read out from those image memories 50 a and 50 b. However, each ofthe position shift detector portions 51 a and 51 b has the constructionhaving the position shift detector portion 442 comprising thestatistical quantity calculation portion 443 and the sub-CPU therein.Namely, as the method for calculating the position shift in the positionshift detector portions 51 a and 51 b can be applied either the methodin the position shift detector portion 44 of the first embodiment, orthe method in the position shift detector portion 44 of the thirdvariation of the first embodiment, however, since there is no necessityof obtaining the position shift quantity between the middle divisionunits in the sub-pixel accuracy, those stages up to obtaining theposition shift in the accuracy of pixel unit are installed into thisposition shift detector portion.

And, the detection images f1 a(x,y), f1 b(x,y), f1 c(x,y) and f1 d(x,y)are cut out and read out for each small division unit from each of theimage memories 52 a and 52 c, in the same manner of the memory 42 ashown in FIG. 1. At the same time, the detection images g1 a(x,y), g1b(x,y), g1 c(x,y) and g1 d(x,y) are cut out and read out for each smalldivision unit from each of the image memories 52 b and 52 d, in the samemanner of the memory 42 b shown in FIG. 1.

The processing contents in the position shift detector portions 53 a–53d, the defect decision portions 46 a–46 d, the defect compiler portion47 a–47 d are basically same to those in the first embodiment. Namely,in the position shift detector portions 53 a–53 d and the defectdecision portions 46 a–46 d, there is executed any one of the method ofthe first embodiment (see FIG. 9), the method of the first variation ofthe first embodiment (see FIG. 13), the method of the third variation ofthe first embodiment (see FIG. 18), and the method of the fourthvariation of the first embodiment (see FIG. 21).

Those position shift detector portions 53 a–53 d have the sameconstructions to the position shift detector portions 44 a–44 d shown inFIG. 1, the defect decision portions 46 a–46 d to those shown in FIG. 1,and also the defect compiler portion 47 a–47 d to those shown in FIG. 1.However, into position shift detector portions 53 a and 53 b areinputted the position shift quantities δx1 a and δy1 a over the firstmiddle division unit in the pixel accuracy, which are obtained in theposition shift detector portion 51 a, while into position shift detectorportions 53 c and 53 d are inputted the position shift quantities δx1 band δy1 b over the second middle division unit in the pixel accuracy,which are obtained in the position shift detector portion Sib.Accordingly, for the position alignment portion 441 in the pixel unit inthe position shift detector portion 53 a, it is enough to execute theposition alignment between the detection image f1 a(x,y) and thecomparison image g1 a(x,y) inputted for each small division unit, on thebasis of the position shift quantities δx1 a and δy1 a in the pixelaccuracy over the above first middle division unit inputted. Also, forthe position alignment portion 441 in the pixel unit in the positionshift detector portion 53 b, it also is enough to execute the positionalignment between the detection image f1 b(x,y) and the comparison imageg1 b(x,y) inputted for each small division unit, on the basis of theposition shift quantities δx1 a and δy1 a in the pixel accuracy over theabove first middle division unit inputted. Further, for the positionalignment portion 441 in the pixel unit in the position shift detectorportion 53 c, it is also enough to execute the position alignmentbetween the detection image f1 c(x,y) and the comparison image g1 c(x,y)inputted for each small division unit, on the basis of the positionshift quantities δx1 b and δy1 b in the pixel accuracy over the abovesecond middle division unit inputted. Furthermore, for the positionalignment portion 441 in the pixel unit in the position shift detectorportion 53 d, it is also enough to execute the position alignmentbetween the detection image f1 d(x,y) and the comparison image g1 d(x,y)inputted for each small division unit, on the basis of the positionshift quantities δx1 b and δy1 b in the pixel accuracy over the abovesecond middle division unit inputted. If not satisfied only by executingthe position alignment on the basis of the position shift quantities δx1a, δy1 a and δx1 b, δy1 b in the pixel accuracy over the first and thesecond middle division units, it is enough to obtain the position shiftquantities by narrowing the investigation area or range upon the saidposition shift quantities δx1 a, δy1 a and δx1 b, δy1 b, in the positionalignment portion 441 in the pixel unit, within each of the positiondetection portions 53 a–53 d.

In this manner, it is possible to make small or to neglect theinvestigation area or range for obtaining the position shift in theposition alignment portion 441 in the pixel unit, within each of theposition detection portions 53 a–53 d.

<First Variation of the Second Embodiment>

A first variation of the second embodiment of the pattern inspectingmethod and the apparatus thereof according to the present invention isshown in FIGS. 29 and 30. In FIG. 29, the gradation compensation portion445 mentioned in the second variation of the first embodiment isprovided between the image memory 48 a and the image memory 50 a andalso between image memory 48 b and the image memory 50 b. Namely, thegradation compensation portion 445 is so constructed that it executesthe gradation compensation on the detection image f7(x,y) and thecomparison image g7(x,y) of the large division unit (at the firststage), which are cut out by the image memories 48 a and 48 b,respectively.

In FIG. 30, the gradation compensation portions 445 a and 445 bmentioned in the second variation of the first embodiment are providedbetween the image memory 50 a and the image memory 52 a or 52 c and alsobetween image memory 50 b and the image memory 52 b or 52 d. Namely, thegradation compensation portions 445 a and 445 b are so constructed thatthey execute the gradation compensation on the detection image f6 a(x,y)and f6 b(x,y) and the comparison image g7(x,y) and g6 b(x,y) of themiddle division unit (at the second stage), which-are cut out by theimage memories 50 a and 50 b, respectively.

Also, as is shown in FIGS. 15 and 17, the gradation compensation can beexecuted on the detection images f1 a(x,y), f1 b(x,y), f1 c(x,y) and f1d(x,y) and the comparison images g1 a(x,y), g1 b(x,y), g1 c(x,y) and g1d(x,y) for each the small unit (at the third stage), which are cut outfrom the image memories 52 a, 52 b, 52 c and 52 d (42 a and 42 b), bythe gradation compensation portion 445. However, in this instance, thegradation compensation unit 445 can be provided among the respectiveimage memories 52 a–52 d and among the respective position shiftdetector portions 53 a–53 d.

As is explained in the above, the gradation compensation can be executedat any stage where the position shift detection is performed by thegradation compensation portion 445. Or, alternatively the gradationcompensation can be executed over all of the stages mentioned in theabove.

In the second embodiment, since the position shift detection isperformed in the stepwise method, the position shift quantities betweenthe images being almost equal to each other in the gradation values canbe obtained in the following stages. With the position shift detectionbetween the images being almost equal to each other in the gradationvalues, it is possible to calculate the position shift correctly,comparing to the position shift detection between the images beingdifferent in the gradation values. In this sense, that the positionshift detection and the gradation compensation can be executedalternatively is also one of the advantages of the present embodiment.

<Common Variation with the First and Second Embodiments>

In the first and second embodiments explained in the above, there wasshown the method in which two images obtained form the same object arecompared, however, it is apparent that the same contents also can bepracticed in the image processing portion in the case where the imageobtained form the object is compared to the image which is detected andstored from another object in advance or which is formed from designdata.

Further, in the first and the second embodiments explained in the abovewas given explanation on the apparatus using the electron opticdetection means or system, however, it is needless to say that the sameoperation can also practiced in the system using any detection means,such as the optical detection means as is shown in FIG. 31, and so on.However, the present invention deals with the problems such as, thedynamic image deformation or distortion caused due to the vibration ofthe stages, change in the magnetic field caused due to the patterndistribution of the test object; and so on, so as to dissolve them.Accordingly, in the case of dealing with the dynamic image deformationor distortion as shown in FIG. 7, it is needed to divide the imagefinely so that the dynamic deformation or distortion can be neglectedtherefrom, so as to perform the defect decision for each division unit.

Namely, in FIG. 31 is shown the structure of an outline of the patterndetection apparatus using the optical detection means (detectionportion) 101′. The optical detection portion 101′ is constructed with astage 2 for mounting the object 100 to be tested (test object) such asthe semiconductor wafer and for shifting it into the x and the ydirections, a light source 3, an illumination optical system 4 forcondensing the light emitted from the said light source 3, an objectionlens 5 for illuminating the object 100 to be tested with theillumination light condensed by the said illumination optical system 4so as to focus it on an optical image obtained by the refection from thetest object 100, and an single dimension image sensor 6 as a one exampleof the photoelectric transfer element, for receiving the light andconverting the optical image focused by an optical detection systemincluding the said objection lens 5 into the image signal depending onthe brightness of the optical image formed. And, the image signaldetected by the single dimension image sensor 6 of the detector portion101′ is inputted into an image input portion (image cutting portion)102′. The image input portion 102′ comprises an A/D converter 39 and animage memory portion (delay circuit) 41′ which memorizes a digitizedimage signal for producing the comparison image g0 from the digitizedimage signal having the gradation values obtained from the A/D converter39. Of course, it is possible to provide the pre-processing circuit 40for executing shading compensation, dark level compensation, filteringprocess, etc. The image processing portion 103 a (103 b), in the samemanner with the constructions shown in FIGS. 1 and 25, also able todecide between the defective candidate and the non-defective candidateupon the basis of the same image processing, as well as to calculate thecharacteristic quantities with respect to the defective candidate.

According to the present invention, it is possible to reduce thepossibility of bringing about or occurring the erroneous or falsereports due to the test objection side and the inspecting apparatus sidethereof, which are caused by the discrepancies including, such as theminute difference in pattern shapes, the difference in gradation values,the distortion or deformation of the patterns, the position shift,thereby enabling the detection of the defects or the defectivecandidates in more details thereof.

Also, according to the present invention, it is also possible to reducethe possibility of bringing about or occurring the erroneous or falsereports due to the test objection side and the inspecting apparatus sidethereof, which are caused by discrepancies including, such as the minutedifference in pattern shapes, the difference in gradation values, thedistortion or deformation of the patterns, the position shift, therebyenabling the detection of the defects or the defective candidates inmore details thereof, in particular, in the inspection of the patternswhich are formed on the object to be tested or inspected by means of theelectron microscope.

Further, according to the present invention, it is possible to reducethe distortion or deformation in the detection image, thereby wideningthe inspection area or region up to the peripheral portion of the testobject.

Furthermore, according to the present invention, it is possible toobtain the image signal having stable gradation values from the patternsformed on the test object by means of the electron microscope, as aresult of this, it is possible to realize the inspection of the moreminute defects or defective candidates with stability.

1. A pattern inspecting method for inspecting a defect or defectivecandidate of patterns on a sample, comprising: a size defining step formeasuring geometric distortion in an image of a standard sample bypicking up the image of the standard sample while shifting a samplingposition on the standard sample, beforehand, and for defining a size forwhich the measured geometric distortion is neglectable; an imagepicking-up step for picking up an image of a sample by shifting asampling position on the sample; an image data obtaining step forobtaining a first image of the sample obtained by the image picking-upstep and for obtaining a second image to be compared with the firstimage; an image dividing step for dividing the first image and thesecond image into images of a division unit having a size not greaterthan the size defined by the size defining step; a calculating step forcomparing a divided image of the first image which is divided in thedividing step with a divided image of the second image which correspondsto the divided image of the first image, and for calculating adifference in gradation values between both of the divided images of thefirst and second images; and an extracting step for extracting thedefect or the defect candidate of the sample in accordance with thecalculated difference in the gradation values of both of the dividedimages obtained from the calculating step.
 2. A pattern inspectingmethod for inspecting a defect or defective candidate of patternsaccording to claim 1, wherein the image picking-up step comprises a stepfor irradiating of an electron beam onto the sample so as to detectsecondary electron generated from the sample by the irradiation of theelectron beam.
 3. A pattern inspecting method for inspecting a defect ordefective candidate of patterns according to claim 1, wherein the imagepicking-up step comprises a step for irradiating of light onto thesample so as to detect reflection light generated from the sample by theirradiation of the light.
 4. A pattern inspecting method for inspectinga defect or defective candidate of patterns on a sample, comprising: asize defining step for measuring geometric distortion in an image of astandard sample by picking up the image of the standard sample whileshifting a sampling position on the standard sample, beforehand, and fordefining a size for which the measured geometric distortion isneglectable; an image picking-up step for picking up an image of asample by shifting a sampling position on the sample; an image dataobtaining step for obtaining a first image of the sample obtained by theimage picking-up step and for obtaining a second image to be comparedwith the first image; an area extracting step for extracting an areaunit having a size not greater than the size defined by the sizedefining step from each of the first image and the second image; aposition shift detecting step for detecting position shift quantitiesbetween the area unit of the first image which is extracted in the areaextracting step and the area unit of the second image corresponding tothe area of the first image; a calculating step for comparing the firstimage with the second image which corresponds to the first image, andfor calculating a difference in gradation values between both of thefirst and second images; and a defect extracting step for extracting thedefect or the defect candidate of the sample in accordance with of thedifference in the gradation values of both of the first and secondimages obtained in the calculating step.
 5. A pattern inspecting methodfor inspecting a defect or defective candidate of patterns according toclaim 4, wherein the position shift quantities detected by the positionshift detecting step includes position shift quantities (δx0, δy0) whichare not greater than a size of a pixel.
 6. A pattern inspecting methodfor inspecting a defect or defective candidate of patterns on a sample,comprising: a size defining step for measuring geometric distortion inan image of a standard sample by picking up the image of the standardsample while shifting a sampling position on the standard sample,beforehand, and for defining a size for which the measured geometricdistortion is neglectable; an image picking-up step for picking up animage of a sample by shifting a sampling position on the sample; animage data obtaining step for obtaining a first image of the sampleobtained by the image picking-up step and for obtaining a second imageto be compared with the first image; an area extracting step forextracting an area unit having a size not greater than the size definedby the size defining step from each of the first image and the secondimage; a position shift detecting step for detecting position shiftquantities between the area unit of the first image which is extractedin the area extracting step and the area unit of the second image whichcorresponds to the area of the first image; a calculating step forcomparing the extracted area image of the first image with the extractedarea image of the second image which corresponds to the extracted areaimage of the first image, and for calculating a difference in gradationvalues between both of the extracted area images of the first and secondimages; and a defect extracting step for extracting the defect or thedefect candidate of the sample in accordance with the difference(sub(x,y)) in the gradation values of both of the extracted area imagesobtained in the calculating step.
 7. A pattern inspecting method forinspecting a defect or defective candidate of patterns according toclaim 5, wherein the position shift quantities detected by the positionshift detecting step includes sub-pixel position shift quantities (δx0,δy0) which are not greater than a size of a pixel.
 8. A patterninspecting method for inspecting a defect or defective candidate ofpatterns as claimed in claim 7, wherein the defect extracting stepincludes a step for extracting the defect or the defect candidate of thesample by using at least one of judgment reference (th(x,y)) for thedifference (sub(x,y)), and a judgment reference (th(x,y)) including acompensation item A(x,y) which is calculated by estimating as minutechanges of the difference (sub (x,y)) correspondence with the sub-pixelposition shift quantities (δx0, δy0) which are obtained for eachextracted area.
 9. A pattern inspecting apparatus for inspecting adefect or defective candidate of patterns on a sample, comprising: asize defining unit which measures geometric distortion in an image of astandard sample by picking up the image of the standard sample whileshifting a sampling position on the standard sample, beforehand, andwhich defines a size for which the measured geometric distortion isneglectable; an image picking-up unit which picks up an image of asample by shifting a sampling position on the sample; an image dataobtaining unit which obtains a first image of the sample obtained by theimage picking-up unit and which obtains a second image to be comparedwith the first image; an image dividing unit which divides the firstimage and the second image into images of a division unit having a sizenot greater than the size defined by the size defining unit; acalculating unit which compares a divided image of the first image whichis divided in the dividing unit with a divided image of the second imagewhich corresponds to the divided image of the first image, and whichcalculates a difference in gradation values between both of the dividedimages of the first and second images; and an extracting unit whichextracts the defect or the defect candidate of said sample in accordancewith the difference in the gradation values of both of the dividedimages obtained from the calculating unit.
 10. A pattern inspectingapparatus for inspecting a defect or defective candidate of patternsaccording to claim 9, wherein the image picking-up unit comprises anirradiation system which irradiates electron beam onto the sample so asto detect secondary electron generated from the sample by theirradiation of the electron beam.
 11. A pattern inspecting apparatus forinspecting a defect or defective candidate of patterns according toclaim 9, wherein the image picking-up unit comprises an irradiationsystem which irradiates light onto the sample so as to detect reflectionlight generated from the sample by the irradiation of the light.
 12. Apattern inspecting apparatus for inspecting a defect or defectivecandidate of patterns on a sample, comprising: a size defining unitwhich measures geometric distortion in an image of a standard sample bypicking up the image of the standard sample while shifting a samplingposition on the standard sample, beforehand, and which defines a sizefor which the measured geometric distortion is neglectable; an imagepicking-up unit which picks up an image of a sample by shifting asampling position on the sample; an image data obtaining unit whichobtains a first image of the sample obtained by the image picking-upunit and which obtains a second image to be compared with the firstimage; an area extracting unit which extracts an area unit having a sizenot greater than the size defined by the size defining unit from each ofthe first image and the second image; a position shift detecting unitwhich detects position shift quantities between the area unit of thefirst image which is extracted by the area extracting unit and the areaunit of the second image which corresponds to the area of the firstimage; a calculating unit which compares the first image with the secondimage which corresponds to the first image, and which calculates adifference in gradation values between both of the images of the firstand second images; and a defect extracting unit which extracts thedefect or the defect candidate of the sample in accordance with thedifference in the gradation values both of the images obtained from saidcalculating unit.
 13. A pattern inspecting apparatus for inspecting adefect or defective candidate of patterns according to claim 12, whereinthe position shift quantities detected by the position shift detectingunit includes position shift quantities (δx0, δy0) which are not greaterthan a size of a pixel.
 14. A pattern inspecting apparatus forinspecting a defect or defective candidate of patterns on a sample,comprising: a size defining unit which measures geometric distortion inan image of a standard sample by picking up the image of the standardsample while shifting a sampling position on the standard sample,beforehand, and which defines a size for which the measured geometricdistortion is neglectable; an image picking-up unit which picks up animage of a sample by shifting a sampling position on the sample; animage data obtaining unit which obtains a first image of the sampleobtained by the image picking-up unit and which obtains a second imageto be compared with the first image; an area extracting unit whichextracts an area unit having a size not greater than the size defined bythe size defining unit from each of the first image and the secondimage; a position shift detecting unit which detects position shiftquantities between the area unit of the first image which is extractedby the area extracting unit and the area unit of the second image whichcorresponds to the area of the first image; a calculating unit whichcompares the extracted area image of the first image with the extractedarea image of the second image which corresponds to the extracted areaimage of the first image, and which calculates a difference in gradationvalues between both of the extracted area images of the first and secondimages; and a defect extracting unit which extracts the defect or thedefect candidate of the sample in accordance with the difference(sub(x,y)) in the gradation values of both of the area images obtainedfrom said calculating unit.
 15. A pattern inspecting apparatus forinspecting a defect or defective candidate of patterns according toclaim 14, wherein the position shift quantities detected by the positionshift detecting unit includes sub-pixel position shift quantities (δx0,δy0) which are not greater than a size of pixel.
 16. A patterninspecting apparatus for inspecting a defect or defective candidate ofpatterns according to claim 15, wherein the defect extracting unitincludes a unit which extracts the defect or the defect candidate ofsaid sample by using at least one of judgment reference (th(x,y)) forthe difference (sub(x,y)), and a judgment reference (th(x,y)) includinga compensation item A(x,y) which is calculated by estimating as minutechanges of the difference (sub (x,y)) in correspondence with thesub-pixel position shift quantities (δx0, δy0) which are obtained foreach extracted area.